ProgrammingHard

char s[] = "Hello"; for (char *p = s; *p; p++) if (*p >= 'a' && *p <= 'z') *p -= 32; printf("%s", s); What is printed?

  1. A. HELPO
  2. B. HELLO
  3. C. HELLA
  4. D. Hallo

Correct answer: B. HELLO

Each lowercase letter is changed to uppercase by subtracting 32. The uppercase H is already in range, so it is not modified.

More C Programming questions

Exams that ask this topic