Ternary in if condition | SoloLearn: Learn to code for FREE!


Ternary in if condition

Is it possible to use ternary operator inside if conditions??

8/26/2018 4:55:13 AM

Sri Sudhan

5 Answers

New Answer




Is there a specific code snippet leading you to believe that you cannot?


No I just came with the situtation where i needed ternary inside if.



No, it’s like c-condition if((c1 && c2) ? true : c3)