Is there another way to do if and else. (C++ QUESTION) | Sololearn: Learn to code for FREE!

+1

Is there another way to do if and else. (C++ QUESTION)

Like, switch, case and default are the same as if and else but different command.

10/22/2021 12:10:03 AM

Idris

4 Answers

New Answer

+1

The ternary operator is another option. (<condition> ? <true expression> : <false expression>)

+2

Brian I think you mean ternary operator. 😉😁

+2

Oh thanks guys, wouldn’t had know it without you!

+1

ChaoticDawg oops! Yes, ternary. I was a little distracted when I typed that. Thank you, friend! I corrected it.