ProgrammingModerateTCS NQT · Wipro

What is printed?

What is printed?
#include <stdio.h>
int main(void) {
    printf("%d", (3 & 1) == 1 ? 'y' : 'n');
}
  1. A. 110
  2. B. 89
  3. C. 121
  4. D. 78

Correct answer: C. 121

(3 & 1) == 1 is true, so the conditional gives 'y'. Printing with %d shows the character code 121.

More C Programming questions

Exams that ask this topic