Home » NO IDEA » Lower case to Upper Case

Lower case to Upper Case

Blog Stats

  • 14,863 hits
December 2013
M T W T F S S
« Oct   Jan »
 1
2345678
9101112131415
16171819202122
23242526272829
3031  
/*Develop a ‘C’ function that will scan a character string passed as an argument 
and convert all lower-case characters to their upper-case equivalents
*/
#include<stdio.h>
#include<ctype.h>// for toupper
#include<string.h>//for strlen
void upper(char a[])
{
	int i;
	char captial[50];
	for(i=0;i<strlen(a);i++)
	{
	captial[i]=toupper(a[i]);
	}
	captial[i]='';
	printf("\n The uppercase String are %s",captial);
}
int main()
{
	char name[50];
	printf("\n Enter the String");
    scanf("%s",name);
    upper(name);
    return 0;
}
Advertisements

1 Comment

  1. […] write a c program that scan all the argument and convert them into lower to upper case […]

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: