What is Ternary Operator?
Ternary Operator is x>y ? x:y
when x>y is true, then x value will be x otherwise y
Example of Ternary Operator:-
#include
#include
int main()
{
//defining three variable
float x,y,big;
//write statement for console message
printf("Enter the two numbers\n");
//now enter two values
scanf("%f%f",&x,&y);
//compare these values using ternary operator
big=(x>y ? x:y);
//print the large number
printf("\n Larger number is %f",big);
getch();
}