Tuesday, 2 April 2013

Convert a string into uppercase


By on 00:45

Convert string into uppercase:-

Q)Write a program to enter string(character array) and convert string into uppercase.

Note:-You can also create this program in c++(c plus plus),java,c#(c sharp) languages etc. with the same logic.

P:void main()
{
char string[40];
int i;
printf("Enter String");
gets(string);
for(i=0;string[i]!='\o';i++)
{
if(string[i]>97 && string[i]<=122)
string[i]=string[i]-32;
}
puts(string);
getch();
}

If you have any query then leave your comments and don't forgot to follow me on Google+,Facebook,Twitter.

0 comments:

Post a Comment

Related Posts Plugin for WordPress, Blogger...