void main()
{
int a=5,b=10;
char x=1,y=0;
if(a,b,x,y)
{
printf("MAIN");
}
}

What is the output?

Options
- Nothing is printed
- MAIN is printed
- AIN is printed
- Compiler Error


CORRECT ANSWER : Nothing is printed

Discussion Board
c.c.c.

mai ccc me form dala hai
kis tarha se taiyari karo

aishan 02-27-2016 02:33 AM

Explain

In the above program if y !=0 (i.e) y equal to any value other than 0 , either positive or negative , main will be printed !

Sivaprakash G 07-15-2014 11:49 PM

c expert

in the above program in if condition if(a,b,x,y) comma operaters are used and the associativity of comma operator is from left to right since first it start with a followed by b and x but there is no effect happen and finally y only will effect the condition in this y =0 so if condition is fail here the result is nothing to print

elayaraj 10-2-2013 02:29 AM

Write your comments


Enter the code shown above:

(Note: If you cannot read the numbers in the above image, reload the page to generate a new one.)


Advertisement