Wednesday, March 24, 2010

66

int main()
{
printf("%d ",5>6==0);
printf("%d",5>6>0);
return 0;
}

Output:

1
0

Logic:

I think no need to explain about the operators > and == .

In 1st printf function:
5>6 gives false truth value(0).
0==0 gives true truth value(1).
so it'll print 1 in buffer.
in 2nd printf function:
5>6 gives false truth value (0)
0>0 gives false truth value(0)
so it'll print 0 in buffer.

0 comments:

Post a Comment