← Quiz: String Handling in C: all 15 questions
Quiz: String Handling in C · Question 8 of 15
What does this print? (code)
What does this print?
#include <stdio.h>
int main(void) {
int d, m, y;
int n = sscanf("15-08-1947", "%d-%d-%d", &d, &m, &y);
printf("%d %d", n, m);
return 0;
}
- A.1 8
- B.3 08
- C.3 8
- D.15 8
Answer & explanation
Correct answer: 3 8
sscanf fills all three ints and returns 3; m is 8 (printed with %d, so no leading zero).
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 →