Finish swap_case(s): in the char array s, turn lower-case letters into upper case and upper-case into lower case; digits, spaces and symbols stay the same. "aBc DeF 42" becomes "AbC dEf 42". The program changes two strings and shows them.
AbC dEf 42 xyz ABC 7-8-9
#include <stdio.h>
void swap_case(char s[]) {
for (int i = 0; s[i] != '\0'; i++) {
// your code here: lower case becomes upper, upper becomes lower
}
}
int main(void) {
char a[] = "aBc DeF 42";
char b[] = "XYZ abc 7-8-9";
swap_case(a);
swap_case(b);
printf("%s\n", a);
printf("%s\n", b);
return 0;
}
Run tries the examples. When they look right, Submit.