Monday, March 22, 2010

63

write a c program for print your name .but,your name may be small letter mean print a capital letter or your name may be capital letter mean print a small letter .example \\enter ur name : sankar The name is: SANKAR (or) enter your name:SAnkar The name is:saNKAR

Program:
int main()
{
char a[]="Shark Srini";
int i;
for(i=0;a[i] ! ='\0';i++)
{
if(a[i]==' ')
continue;
else if(a[i] < 97)
a[i]+=32;
else
a[i]-=32;
}
printf("%s",a);
return 0;
}

Output:
sHARK sRINI

0 comments:

Post a Comment