Multiple choice

What is the output of the given program snippet in C Language? main() {
int a=0.5,c=0.5;
float b=2,d=4;
if(b=d&&a++<=c) printf(This is true);
else
printf(This is false); }

  1. Compilation error: Incompatible types

  2. This is false

  3. This is true

  4. Runtime exception

  5. None of these

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

b=d is not a comparison but d’s value is assigned to b, and returns true and a++<=c will result true too. “This is true” will be printed.