Advertisement

CONVERT LOWER CASE TO UPPER CASE

#include<stdio.h>
#include<conio.h>
void main()
{
clrscr();
int c=0;
char ch, s[10];
printf("input a string\n");
gets(s);
while(s[c] !='\0')
{
ch=s[c];
if(ch>='A'&&ch<='Z')
s[c]=s[c]+32;
else if(ch>='a'&&ch<='z')
{
s[c]=s[c]-32;
c=c+1;
printf("%s\n",s);
}
}
getch();
}

Post a Comment

0 Comments