Advertisement
Guest User

Untitled

a guest
Dec 10th, 2019
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int main ()
  4. {
  5. int c = 0;
  6. char ch, s[1000];
  7.  
  8. printf("Input a string\n");
  9. gets(s);
  10.  
  11. while (s[c] != '\0') {
  12. ch = s[c];
  13. if (ch >= 'A' && ch <= 'Z')
  14. s[c] = s[c] + 32;
  15. else if (ch >= 'a' && ch <= 'z')
  16. s[c] = s[c] - 32;
  17. c++;
  18. }
  19.  
  20. printf("%s\n", s);
  21.  
  22. return 0;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement