+ 1
What is the output of this code
int x=3; if(x==2) cout<<"0"; else { cout<<"4"; cout<<"(x<5)+1; }
10 Answers
+ 1
#cloudcoder what is the error in this code plz tell me
+ 8
this works fine:
int x=3;
if(x==2)
cout<<"0";
else
{
cout<<"4";
cout<<(x<5)+1;
}
+ 6
error
+ 5
You can use your questions by writing them as quiz questions. Writing in here and asking other people is not an appropriate behaviour!
+ 2
I have posted the error free code above
+ 1
#cloudcoder how?
+ 1
The code from CloudCoder works. output 42.
+ 1
(x < 5) is true, so it is 1 and then you add 1 that makes 2.
+ 1
@Deep you have write:
...cout<<"(x <5)...
buy you mustn't use quote here.
it must be:
...cout<<(x <5)...
like @CloudCoder said.
0
#paul jacobs plz explain about 2 in this code