if it were if(a,b,y,x) then output wud hav been EXAM
On Fri, Aug 12, 2011 at 4:14 AM, Prakash D cegprak...@gmail.com wrote:
@anuj kumar: try this
#includestdio.h
#includestring.h
int main()
{
int a=10,b=20;
char x=1,y=0;
printf(%d\n,a,b,x,y);
the thing is
Condition if(a,b,x,y)
is evaluated by the last variable present in it bcoz Comma Operator return
the last variable or constant present in it.
give y some other value than 0 you will see the difference
--
Amol Sharma
Third Year Student
Computer Science and Engineering
MNNIT
void main()
{
int a=10,b=20;
char x=1,y=0;
if(a,b,x,y)
{
printf(EXAM);
}
}
o/p XAM
how it is coming plz help me,..
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send email to
print nothing , your output is wrong
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to
algogeeks+unsubscr...@googlegroups.com.
For
Yep,
Ideally, if() statement evaluates the last push stack value from the stack
and apparently here the last value evaluates to be 0 resulting the failure
of the if condition.
Please verify the compilation. :)
Prem
On Thu, Aug 11, 2011 at 4:21 PM, hary rathor harry.rat...@gmail.com wrote:
@anuj kumar: try this
#includestdio.h
#includestring.h
int main()
{
int a=10,b=20;
char x=1,y=0;
printf(%d\n,a,b,x,y);
printf(%d\n,(a,b,x,y));
if(a,b,x,y)
{
printf(EXAM);
}
getchar();
}
this will print 10 and 0
because if the outer bracket is not