Back To C Single Dimensional Arrays Index
//program to input a string and convert all lowercase letters to uppercase letters and all uppercase letters to lowercase letters #include
#include
void main() { char str[10]; int i; clrscr(); printf("\nenter a string "); gets(str); printf("\noriginal string is %s",str); for(i=0;str[i]!='\0';i++) { if((str[i]>='A') && (str[i]<='Z')) { str[i]=str[i]+32; } else { str[i]=str[i]-32; } } printf("\nconverted string is %s",str); getch(); }