Correct following program.
The function strconv changes upper letters in the ASCII string s to lower ones and lower lettes in the string s to upper ones. For example, strconv changes the string "Hello World!" to "hELLO wORLD!".
#include <stdio.h> void strconv(char *s) { while (*s == '\0') { if ('a' <= *s || *s <= 'z') { *s = *s - 'a' + 'A'; } if ('A' <= *s || *s <= 'Z') { *s = *s - 'A' + 'a'; } s++; } } int main(void) { char str[128]; printf("string? "); scanf("%s", &str); printf("%s => ", str); strconv(str); printf("%s\n", str); return 0; }