h! I'm just a student and I'm looking for ten short examples of conditional statement,,. Can you help me?
stuff like if a equals b or a greater than c then take this path else if a equals b and a is less than c then take this path else ... other conditional tests, switch statements, sentinel controlled loops, and such.
expression1 ? expression2 : expression3 if expression1 satisfied(i.e. nonzero) then only expression2 will return, otherwise expression3 will return. Ex1: 1?"TRUE":"FALSE";. here you will get "TRUE". because the expression1 is a nonzero value. Ex2: int i=1; (i-1)?"TRUE":"FALSE";. here you will get "FALSE". because the expression1 i.i (i-1) gives a nonzero value.