The Conditional Operator in C, also called a Ternary operator, is one of the Operators, which used in the decision-making process, we use a conditional operator to reduce the line of codes. We can use a conditional operator to replace the if-else condition. The basic syntax of a Ternary Operator is given below:
Syntax
(condition) ? Expression1: Expression2;
To be more clear you can see here:-
(condition)? True: False;
Flowchart
Program
QUESTION:- write a conditional program to print the greatest value from user input.
Output
Enter a value of a: 7
Enter a value of b: 10
The greatest value is 10
0 Comments