Operators Confusion | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Operators Confusion

11th Jul 2020, 10:36 AM
Ayabonga Mpeta
7 Answers
+ 2
You questions looks incomplete..... Can you elaborate a bit more.
11th Jul 2020, 10:36 AM
Arsenic
Arsenic - avatar
+ 2
The problem is to print welcome on the screen. int age = 26 int money = 4; if (age > 21 this is the part I’m stuck on, money > 500 { cout << “welcome” endl; }
11th Jul 2020, 10:54 AM
Ayabonga Mpeta
+ 1
It’s logical operators.
11th Jul 2020, 10:50 AM
Ayabonga Mpeta
+ 1
Ayabonga Mpeta Use *And(&&)* operator if you want both conditions to be true(that is age should be greater than 21 and money shoul also be greater than 500) Use *Or(||)* operator if you want only one of the condition to be true(that is either age is greater than 21 OR money is greater than 500)
11th Jul 2020, 10:59 AM
Arsenic
Arsenic - avatar
+ 1
Thanks for help Arsenic.
11th Jul 2020, 11:02 AM
Ayabonga Mpeta
0
yeah ok
11th Jul 2020, 10:48 AM
Ayabonga Mpeta
0
What exactly confuse you in logical operators?
11th Jul 2020, 10:51 AM
Arsenic
Arsenic - avatar