Ternary Operator in C Language

Updated on May 31, 2025 | By Learnzy Academy

The conditional operator (also called the ternary operator) is a special operator in C that allows you to make quick decisions based on a condition. It is used as a shortcut for simple if-else statements and works with three operands, which is why it's called "ternary."

It works with three operands, that's why it's called "ternary."

Syntax:-

condition ? expression_if_true : expression_if_false;
Click here to download practice questions on Ternary Operator