Is the ternary operator written x : y

Z or x

Showing Answers 1 - 2 of 2 Answers

rajanikanth

  • Sep 15th, 2005
 

 It is written x ? y : z. 

  Was this answer useful?  Yes

The ternary operator is written as:x ? y : zand reads:if( x ) then y else the result is returned and may be assigned.ex:int result = (2<3) ? 2 : 3;

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions