- #1
camel-man
- 76
- 0
I was wondering if anyone knew if it is possible to construct an if else if with the ternary operator in C.
I know that we can use it for if else, but what if you wanted multiple conditions for else if in your statement?
perhaps?
I know that we can use it for if else, but what if you wanted multiple conditions for else if in your statement?
Code:
printf("%d",(a>5)?1:(a<5)?0:10);
//Just a silly example