Give the output: #include <stdio.h> int main() { int y = 0; int x = (y != 0); printf("%d", x); return 0; }

Give the output:

#include <stdio.h>
int main() {
    int y = 0;
    int x = (y != 0);
    printf("%d", x);
    return 0;
}
  1. a) 0
  2. b) 1
  3. c) A big negative number
  4. d) Compiler Error

From the Combined Bank Assistant Programmer (CSE) February 2024 – Written (BIBM) exam, question 40 of 41.

More from this paper