← Quiz: C Data Types and Operators: all 10 questions
Quiz: C Data Types and Operators · Question 1 of 10
What does this print? (code)
What does this print?
#include <stdio.h>
int main(void) {
int a = 10, b = 4;
printf("%d %d", a / b, a % b);
return 0;
}
- A.2.5 2
- B.2 2
- C.2 4
- D.3 2
Answer & explanation
Correct answer: 2 2
10 / 4 = 2 (integer division) and 10 % 4 = 2.
Can you get the rest right without peeking?
Take the timed Quiz: C Data Types and Operators quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →