program in c to convert case of a given string.
#include<stdio.h> #include<conio.h> #include<string.h> void main() { char str[20],i; printf("Enter a string :-"); gets(str); printf("The converted sentence is "); for(i=0;str[i]!='\0';i++) { if(str[i]>='A'&&str[i]<='Z') printf("%c",str[i]+32); else printf("%c",str[i]-32); } getch(); }Output:-
1 Comments