Answer to Question #56419 in C++ for raneem
Write a program that reads a string them changes capital letters with small letters and
small letters with capital letters?
can you please help me know the answer :(?
1
2015-11-19T03:42:32-0500
#include <stdio.h>
#include <ctype.h>
int main() {
char buffer[100];
fgets(buffer,100,stdin);
for(char *c=buffer; *c!='\0'; c++) {
if(*c>='A' && *c<='Z') *c=tolower(*c);
else if(*c>='a' && *c<='z') *c=toupper(*c);
}
printf("%s",buffer);
return 0;
Need a fast expert's response?
Submit order
and get a quick answer at the best price
for any assignment or question with DETAILED EXPLANATIONS!
Learn more about our help with Assignments:
C++
Comments
Leave a comment