Question discussion

What will be the output of the given C program?

359260Medium DSSSB TGT Computer Science 0 replies 0 views
0
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;
}
  • A0
  • B3
  • C4
  • D7
Correct answer: D

Explanation

4 ^ 3 = 100 ^ 011 = 111 = 7.

Discussion 0

Nobody has replied yet. Start the discussion!