Sunday, 11 December 2011

a program to print a string and its change in c

#include
#include
main()
{
char n[20];
int j;
clrscr();
printf("Enter a string");
gets(n);
for(j=0;n[j]!='\0';j++)
{
if(n[j]>=65 && n[j]<=90) printf("%c",n[j]); else if(n[j]>=97 && n[j]<=122)
printf("%c",n[j]-32);
else
printf("%c",n[j]);
}
getch();
}

OUTPUT
Enter a string : tejkumar saharan
TEJKUMAR SAHARAN

No comments:

Post a Comment