Breaking News

What is Conditional & ternary operators In C Programming Language?

The conditional operator? and: are sometimes called ternary operators.
ternary operator is one which contains three operands.
The general form of ternary operator is:
exp 1 ? exp 2 : exp 3
The operator works as, if exp 1 is evaluated first. If the result is true then exp 2 is executed, otherwise exp 3 is executed.
A program of ternary operator:
Output of the program:

Check Also

Type modifier In C Programming Language

The basic data types may have modifier preceding them to indicate special properties of the object being …