This is the source code from the C Programming Tutorial. In this source code, you are going to learn Conditional Operator in a C Programming language.
C Ternary Operator (?:)
A conditional operator is a ternary operator, that is, it works on 3 operands. You can say that conditional operator is another way of writing an if-else statement in C programming.
Conditional Operator Syntax
conditionalExpression ? expression1 : expression2
Here is the source code
printf("Enter your age? \n");
// using conditional operator
printf(age > 50 ? "you are old"
: "you are young");