answersLogoWhite

0


Best Answer

#include<stdio.h>

#include<conio.h>

#include<ctype.h>

main()

{

char string[80];

int n,k=0;

clrscr();

while((string[k]=getche())!='\r')

k++;

string[k]='\0';

n=k;

k=0;

while(k<n)

{

putchar(toupper(string[k]));

k++;

}

}

User Avatar

Wiki User

12y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

12y ago

This is the function I use in my programs:

/**

* Returns the string with the first letter capitalized, the rest lowercase.

* @param s The String to capitalize

* @return The capitalized string

*/

public static String capitalCase(String s)

{

return s.toUpperCase().charAt(0) + s.toLowerCase().substring(1);

}

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Program for doing upercase of 1st letter of string?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

Do Example program for c using string?

If this is a homework assignment, you really should consider doing it yourself#include #include int main (int argc, char *argv[]) {printf ("Hello world!\n");return 0;}


Where is the status bar?

The status bar is at the bottom of a program window, and it generally displays what the program is currently doing, or information about program objects you may have the cursor over, such as buttons or text boxes.


Write a program to find a substring in a given string in c?

#include&lt;stdio.h&gt; #include&lt;conio.h&gt; int main() { int i=0,j=0,k=0,count=0,l=0,k1=0; char a[80],b[80]; clrscr(); printf("\nEnter main string:-\n"); gets(a); printf("\nEnter sub-string:-\n"); gets(b); l=strlen(b); while (a[i]!=EOF) { if (a[i]==b[j]) { i++; j++; k1=1; if (j==l) { j=0; k=1; count=count+1; } } else { if (k1==1) { j=0; k1=0; } else i++; } } if (k==1) { printf("\n\nThe given sub-string is present in the main string."); printf("\nIt is present %d times.",count); } else { if (k==0) printf("\n\nThe given sub-string is not present in the main string."); } }


Write a 'c' program to calculate the frequencies of different alphabets present in a given string the string of alphabets is to be taken as input from the keyboard?

/* For a short string, like "abaz" a Hashmap like (a:2, b:1, z:1) will be shorter, than a whole alphabet*/ #include&lt;stdio.h&gt; #include&lt;conio.h&gt; main() { int count,i,j; char str[50]; printf("Enter string : "); gets(str); for(i=0;i&lt;=strlen(str)-1;i++) { count=1; if(str[i]==' ') continue; for(j=i+1;j&lt;=strlen(str)-1;j++) { if(str[i]==str[j]) { str[j]=' '; count++; } } printf("%c : %d \n",str[i],count); } getch(); } /*Answered by Ankush Monga Doing DOEACC B level*/


With an example explain the different string methods in java?

Strings, which are widely used in Java programming, are a sequence of characters. In the Java programming language, strings are objects. The Java platform provides the String class to create and manipulate strings. Creating Strings The most direct way to create a string is to write: String greeting = "Hello world!"; In this case, "Hello world!" is a string literal-a series of characters in your code that is enclosed in double quotes. Whenever it encounters a string literal in your code, the compiler creates a String object with its value-in this case, Hello world!. As with any other object, you can create String objects by using the new keyword and a constructor. The String class has 11 constructors that allow you to provide the initial value of the string using different sources, such as an array of characters: char[] helloArray = { 'h', 'e', 'l', 'l', 'o', '.'}; String helloString = new String(helloArray); System.out.println(helloString); The last line of this code snippet displays hello. Note: The String class is immutable, so that once it is created a String object cannot be changed. The String class has a number of methods, some of which will be discussed below, that appear to modify strings. Since strings are immutable, what these methods really do is create and return a new string that contains the result of the operation.

Related questions

How do you change the upercase to lower or lower to upercase in unix?

There are many different ways of doing this. If you are asking about the content of a file, use the 'tr' (translate) command. The actual parameters may vary from system to system, so use the 'man tr' command to be sure. For example, you may be able to change from lower to upper case by: tr '[a-z]' '[A-Z]' &lt; infile &gt; outfile


What is string painting?

String painting is when you get a piece of string and you add pva glue to wherever you doing this and you just add you string in whatever position you want it to be in and you let the string dry up and there you are done.


What 8 letter word can have a letter taken away and it still makes a word. Take another letter away and it still makes a word. Keep on doing that until you have one letter left. What is the word?

The word is starting! Starting, staring, string, sting, sing, sin, in, I.


Do Example program for c using string?

If this is a homework assignment, you really should consider doing it yourself#include #include int main (int argc, char *argv[]) {printf ("Hello world!\n");return 0;}


Is Raffi doing concerts anymore?

Yes, he is doing a string of 3 concerts in Vancouver, Victoria and Seattle in fall 2012.


How old does a girl have to be to wear a g string?

When she feels comfy doing so


What is exporting files?

When you move files from one program to another what you doing is exporting the file from one program and importing it into the other program


What does guitar have to do with science?

Acoustic, sound wave and vibration of string, harmonized of wave from differ of tension and length of the string vibrate. Science is in everything. When we explaining then it is science but when we doing it we use art.


How do you repair pleated window blinds?

Fusing string is a very helpful technique to know when doing blind repairs and can be also used for other projects that use polyester sting. This technique does not work on cotton string, or other non-synthetic string. anydoor.com.au


What is the circumference of circles?

The circumference is the length of the outside of the circle. For example, if you took a piece of string and made a circle with it, then laid the string straight, the length of the string would be the circumference. The circumference of a circle can be measured by doing two times the radius of the circle times the mathematical constant, pi.


Beside the you the people program are schools doing enough to edgecate voters?

no


What in your school doing to keep students engaged in school?

Program's, and assemblies