0

Whatis the result of the following code?

void main() { int a,b=10; if((a=b=1)==1)cout<<a<<":"<<b;}

20th Oct 2016, 9:32 AM
Jatin Katariya
Jatin Katariya - avatar
5 Réponses
+ 1
1:1. this is the result
20th Oct 2016, 9:59 AM
yungcheda
yungcheda - avatar
0
you set in your second line a and b equal to 1, so firsthand eitherway if a or b comes out it will be "1" if you want to know which value comes out its the value of a. As you set a and b equal to , the condition (a=b==1) will be true. I cannot guarantee for syntax though
20th Oct 2016, 9:54 AM
80think08
80think08 - avatar
0
Hey man you gave National Cyber Olympiad(NCO). Today????? The answer is. 1:1.
20th Oct 2016, 11:57 AM
Jishnu
Jishnu - avatar
0
1:1
20th Oct 2016, 5:54 PM
suman kumar
suman kumar - avatar
0
will some one elaborate the code and explain
12th Jan 2017, 2:34 PM
Akshay S A