Ternary Operator (Conditional Operator) in C Programming Language – An Operator with Three Operands



Ternary Operator (Conditional Operator) in C Programming Language – An Operator with Three Operands

Ternary Operator (Conditional Operator) in C Programming Language - An Operator with Three Operands

In this video, you will learn about the Ternary (Conditional) Operator, which is also known as the Conditional Operator in C Programming Language. You will learn what is Ternary (Conditional) Operator and also learn how to use Ternary (Conditional) Operator in C programming. This video provides an easy coding example of using the Ternary (Conditional) Operator in C Programming.

An operator that works with three (3) operands is called Ternary (Conditional) Operator. Basic Structure of using the Ternary (Conditional) Operator in C is as follows:

Variable = (condition) ? value1 : value2

If the condition is TRUE then value1 is set as the value of the Variable, otherwise, that is, if the condition is FALSE then value2 is set as the value of the Variable. This is why TERNARY Operator is also called the CONDITIONAL Operator as this operator is said to be an alternative of IF-ELSE Control Statement Block.

#ternaryoperator
#operator
#cprogramming
#cprogrammingvideo