Conditional Operator Statement in C


The conditional operator is also known as a ternary operator. The conditional statements are the decision-making statements which depends upon the output of the expression. It is represented by two symbols, i.e., '?' and ':'.

As conditional operator works on three operands, so it is also known as the ternary operator.

Source Code

// Conditional Operator Statement ?:
int main()
{
    int a,b,c;
    printf("\nEnter The Value of A &  B : \n");
    scanf("%d%d",&a,&b);
    c=a>b?a:b;
    printf("\nThe Greatest No is %d",c);
    return 0;
}
 
To download raw file Click Here

List of Programs


Sample Programs


Switch Case in C


Conditional Operators in C


Goto Statement in C


While Loop Example Programs


Looping Statements in C

For Loop Example Programs


Array Examples in C

One Dimensional Array


Two Dimensional Array in C


String Example Programs in C


Functions Example Programs in C


Learn All in Tamil © Designed & Developed By Tutor Joes