← Quiz: C Data Types and Operators: all 10 questions
Quiz: C Data Types and Operators · Question 7 of 10
What does this print? (code)
What does this print?
#include <stdio.h>
int main(void) {
printf("%d %d %d\n", 5 && 0, 5 || 0, !5);
return 0;
}
- A.5 5 0
- B.1 1 0
- C.0 1 0
- D.0 1 -5
Answer & explanation
Correct answer: 0 1 0
&& needs both true (0 is false), || needs one true, and ! of any non-zero value is 0.
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 →