Warning: implode(): Invalid arguments passed in /www/wwwroot/jobquiz.info/mdiscuss.php on line 336 What will be the output of the program? #include<stdio.h> int main() { int a=100, b=200, c; c = (a == 100 || b > 200); printf("c=%d\n", c); return 0; } ?->(Show Answer!)
1. What will be the output of the program? #include<stdio.h> int main() { int a=100, b=200, c; c = (a == 100 || b > 200); printf("c=%d\n", c); return 0; }
Ask Your Doubts Here
Comments
By: guest on 01 Jun 2017 06.01 pm
Step 1: int a=100, b=200, c;
Step 2: c = (a == 100 || b > 200);
becomes c = (100 == 100 || 200 > 200);
becomes c = (TRUE || FALSE);
becomes c = (TRUE);(ie. c = 1)
Step 3: printf("c=%d\n", c); It prints the value of variable i=1
Hence the output of the program is '1'(one).
Step 2: c = (a == 100 || b > 200);
becomes c = (100 == 100 || 200 > 200);
becomes c = (TRUE || FALSE);
becomes c = (TRUE);(ie. c = 1)
Step 3: printf("c=%d\n", c); It prints the value of variable i=1
Hence the output of the program is '1'(one).