← Quiz: C Output Questions: all 10 questions
Quiz: C Output Questions · Question 9 of 10
What does this print? (code)
What does this print?
#include <stdio.h>
int main(void) {
char c = 'a' + 25;
printf("%c %d\n", c, 'z' - 'a');
return 0;
}
- A.a 25
- B.z 25
- C.z 26
- D.{ 25
Answer & explanation
Correct answer: z 25
Lowercase letters have consecutive codes, so 'a' + 25 is 'z' and 'z' - 'a' is 25.
Can you get the rest right without peeking?
Take the timed Quiz: C Output Questions quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →