← Quiz: String Handling in C: all 15 questions
Quiz: String Handling in C · Question 12 of 15
What does this print? (code)
What does this print?
#include <stdio.h>
int main(void) {
int d, m, y;
sscanf("21/11/2026", "%d/%d/%d", &d, &m, &y);
printf("%d %d\n", m, y - 2000);
return 0;
}
- A.21 26
- B.11 26
- C.11 2026
- D.0 0
Answer & explanation
Correct answer: 11 26
The / characters in the format must match the text, so the three numbers go into d, m and y.
Can you get the rest right without peeking?
Take the timed Quiz: String Handling in C quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →