ternary operator   ?:

Syntax: condition ? first_statement : second_statement;

If condition is true then first_statement will be executed otherwise second_statement will be executed.

Example:

OUTPUT

Input a value : -10
Value is negative


Next Previous