Check if X is Less than Y (Boolean)

Accept two integers X and Y as input. The program must print 1 if is less than Y. Else print 0 as the output.

Example Input/Output 1:
Input:
4 5

Output:
1

Example Input/Output 2:
Input:
5 5

Output:
0

#include <stdio.h> 
int main()
{
    int X, Y;
    scanf("%d %d", &X, &Y);
    printf("%d", X < Y);
    return 0;
}
Previous Article

Check If Two Integers are Equal (Using if-else)

Next Article

Function printAlarmTimings

Write a Comment

Leave a Comment

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