Question 56Asked in DSSSB TGT Computer Science (Technical), 12 Sep 2025, Shift 1 (9:00 AM)

What will be the output of the given C program? int main() {

What will be the output of the given C program? #include <stdio.h> int main() { int a = 4; int b = 3; int result; result = a ^ b; printf("%d", result); return 0; }
  1. A0
  2. B3
  3. C4
  4. D7
Show answerHide answer

Correct answer: (D) 7

Explanation

^ is bitwise XOR: 4 = 100 and 3 = 011, so 100 XOR 011 = 111 = 7.

From DSSSB TGT Computer Science PYQ (Technical), 12 Sep 2025, Shift 1 (9:00 AM)

This is question 56 of DSSSB TGT Computer Science PYQ (Technical), 12 Sep 2025, Shift 1 (9:00 AM). See all questions of this paper with answers, or attempt the paper as a timed online test to get your score and all-India rank.