Can anyone help me fix my code. (Nested if statement C++) I tried to run it but it doesn't give reasonable outputs. THANK YOU!!! | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Can anyone help me fix my code. (Nested if statement C++) I tried to run it but it doesn't give reasonable outputs. THANK YOU!!!

Havibg troubles using Nested if statements in C++ https://code.sololearn.com/cmXlriMpub5N/?ref=app https://code.sololearn.com/cmXlriMpub5N/?ref=app

16th Mar 2021, 1:04 AM
Jessica Zarate
Jessica Zarate - avatar
4 Answers
+ 3
https://code.sololearn.com/cIb5J96zV1lg/?ref=app
16th Mar 2021, 1:12 AM
visph
visph - avatar
+ 1
you could do: if (condition) {} else if (other_condition) {} else {} with how many 'else if' conditions you need, with or without a final else (without condition)...
16th Mar 2021, 1:21 AM
visph
visph - avatar
+ 1
You can put multiple conditions inside one if statement by using logical operators like AND (&&)/ OR (||), so these nested if will no longer be needed
16th Mar 2021, 3:12 AM
Michal Doruch
0
Oh i can just use else if (). Thank you sooo sooo much visph
16th Mar 2021, 1:20 AM
Jessica Zarate
Jessica Zarate - avatar