Multiple choice

Find out the output of the given program, if any, or find out the error. Give the answer of the program in binary language.

int main()
{
int a=7,b=15,c;
c=a|b;
printf("the result comes out to be is :- %d",c);
}

  1. The result comes out to be: 0111.

  2. The result comes out to be: 1111.

  3. The result comes out to be is: 1000.

  4. The result comes out to be is: 0110.

  5. Compiler error

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

This program will just OR the binary values of 7 and 15. So, after ORing them, the result comes out to be 15 in binary which is 1111. So, this option is correct.