Multiple choice

#include<stdio.h> #include<conio.h> int main() { int a=9,b=10,c; c=(b<a || b>a); printf(c=%d,c); getch(); }

Find the output of the above program or error, if any.

  1. c=1

  2. c=0

  3. c=-1

  4. garbage value

  5. error in the program

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

This program will first compare a > b, which is false as 9 < 10. So result will be 0. Then it will compare b > a (10 > 9) which is true. So result will be 1.So it will become as c=(0 || 1). So binary of 0 OR binary of 1. The result will be 1 0 0 0 0 0 1____0 0 1. So, this is the correct answer.