Re: [algogeeks] how o/p is coming

2011-08-12 Thread sirshak das
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);

Re: [algogeeks] how o/p is coming

2011-08-12 Thread Amol Sharma
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

[algogeeks] how o/p is coming

2011-08-11 Thread Anuj kumar
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

Re: [algogeeks] how o/p is coming

2011-08-11 Thread hary rathor
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

Re: [algogeeks] how o/p is coming

2011-08-11 Thread Prem Krishna Chettri
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:

Re: [algogeeks] how o/p is coming

2011-08-11 Thread Prakash D
@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