Day#87 C' Coding Challenge

Day#87 C' Coding Challenge

What is the output of the below code?

#include<stdio.h> #define FALSE 0 int main() { int var_1=1; int var_2=2; int var_3=5; var_3=var_1==var_2; printf("%d\n",var_3); return FALSE; }

-----------------------------------------------------------------

In the above program, 3 variables var_1,var_2,var_3 are declared.

var_1==var_2 is not an expression and it is a relational operation. In a relational operation, output is boolean, TRUE or FALSE. As var_1 is not equal to var_2, the result is FALSE which meant 0.

So, var_3 = 0, the output of the program is 0.

Post a Comment

0 Comments