Nov 20, 2012

A program to convert string in lower case to upper case



#include<stdio.h>
#include<conio.h>
void main()
{
char a[30];
int i,l;
clrscr();
puts("enter your string in lower case=");
gets(a);
l=strlen(a);
for(i=0;a[i]!='\0';i++)
{
if(a[i]>='a'&&a[i]<='z')
{
a[i]=a[i]-32;
}
}
puts(a);
getch();
}


/* output
enter your string in lower case=
i am learning                                                                   
I AM LEARNING
*/


0 comments:

Post a Comment