Go4Expert

Go4Expert (http://www.go4expert.com/)
-   C (http://www.go4expert.com/forums/c/)
-   -   solve it and tell me how it works? (http://www.go4expert.com/forums/solve-tell-t26417/)

Ankur Kamboj 1Aug2011 23:31

solve it and tell me how it works?
 
main(){
int i = 10, j =20;
j = i ,j?(i,j)?i :j:j;
printf(%d\n%d,i,j);
}

the answer is 10 10

shabbir 2Aug2011 09:13

Re: solve it and tell me how it works?
 
See the use of comma operator and it will be clear why you have that as a answer.

Ankur Kamboj 2Aug2011 12:11

Re: solve it and tell me how it works?
 
Quote:

Originally Posted by shabbir (Post 85633)
See the use of comma operator and it will be clear why you have that as a answer.

thanks alot...


All times are GMT +5.5. The time now is 06:55.