🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← 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;
}
  1. A.5 5 0
  2. B.1 1 0
  3. C.0 1 0
  4. 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 →