Check if X is Greater than or Equal to Y (Using Ternary Operator)

Accept two numbers X and Y as the input. The program must print YES if X is greater than or equal to Y. Else the program must print NO as the output using ternary operator.

Example Input/Output 1:
Input:
6 3

Output:
YES

Example Input/Output 2:
Input:
681 954

Output:
NO

#include<stdio.h>
#include <stdlib.h>
int main()
{
    int X, Y;
    scanf("%d %d",&X,&Y);
    printf("%s", (X>=Y)?"YES":"NO");
    return 0;
}
Previous Article

Alphabet Matrix - Minimum Sum Path

Next Article

Python Test : Numeric Types

Write a Comment

Leave a Comment

Your email address will not be published. Required fields are marked *