0

In this question money=4 , and in if condition i use & operator and it does not satisfies the conditon which is money>500 ,

29th Sep 2018, 5:10 PM
TEAM ELIMINATOR
TEAM ELIMINATOR - avatar
8 Answers
+ 7
what answer you gave? and what was the question?
29th Sep 2018, 8:03 PM
blACk sh4d0w
blACk sh4d0w - avatar
+ 6
Please provide the original question.
29th Sep 2018, 5:34 PM
Harsh
Harsh - avatar
+ 3
Since money is less than 500, nothing will be displayed on the console window.
29th Sep 2018, 5:49 PM
Harsh
Harsh - avatar
+ 3
Do you mean that "welcome" was displayed on the console window?
29th Sep 2018, 5:56 PM
Harsh
Harsh - avatar
0
int age = 23; int money =4 ; if(age>21&&money>500) { cout<<"welcome"; } //I'm not able to send the screenshot , I have screenshot too //
29th Sep 2018, 5:42 PM
TEAM ELIMINATOR
TEAM ELIMINATOR - avatar
0
TEAM ELIMINATOR money is 4 which is less than 500 you are checking in your if statement if it is greater than 500 so it will not run unless money is 501 or more.
29th Sep 2018, 5:48 PM
Mooaholic
Mooaholic - avatar
0
I m still not getting , the code is correct but the condition is wrong , so why would it display me correct ?
29th Sep 2018, 5:50 PM
TEAM ELIMINATOR
TEAM ELIMINATOR - avatar
0
it's says ur answer is correct , so it should print according to the app , but it shouldn't according to the code
29th Sep 2018, 5:57 PM
TEAM ELIMINATOR
TEAM ELIMINATOR - avatar