Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main ()
- {
- int c = 0;
- char ch, s[1000];
- 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++;
- }
- printf("%s\n", s);
- return 0;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement