ProgrammingHard

char s[] = "AbC"; for (char *p = s; *p; p++) *p = isupper((unsigned char)*p) ? tolower((unsigned char)*p) : toupper((unsigned char)*p); printf("%s", s); What is printed?

  1. A. aBd
  2. B. ZBc
  3. C. aBcc
  4. D. aBc

Correct answer: D. aBc

Each letter swaps case: A becomes a, b becomes B, and C becomes c.

More C Programming questions

Exams that ask this topic