🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← Quiz: C Introduction: all 10 questions

Quiz: C Introduction · Question 7 of 10

What does this print? (code)

What does this print?

#include <stdio.h>
int main(void) {
    printf("%d %c\n", 'A' + 1, 'A' + 1);
    return 0;
}
  1. A.B B
  2. B.65 A
  3. C.66 B
  4. D.A1 B
Answer & explanation

Correct answer: 66 B

A character is stored as a number ('A' is 65). %d prints the number 66, %c prints the character with that code, B.

Can you get the rest right without peeking?

Take the timed Quiz: C Introduction quiz free. Pass it to earn XP and count towards your certificate.

Start the quiz →