Saturday, March 19, 2011

If condition operation

# include "stdio.h"

int main()
{
int a=10,b=5,c=3,d=3;
if((a<b)&&(c=d++))
{
printf("%d %d %d %d\n" ,a,b,c,d);
}
else
{
printf("%d %d %d %d\n" ,a,b,c,d);
}
return 0;
}

OUTPUT:

10 5 3 3
Press any key to continue . . .

Note: In if function first condition itself fail. it wont checking the second condition for && operation.

No comments:

Post a Comment