Compare Two integers with Logical NOT and AND Operators (Boolean )

Accept two integers X and Y as the input. The program must print 1 if X and Y are not equal and also Xis greater than Y. Else the program must print as the output.

Example Input/Output 1:
Input:
6 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 && X > Y);
return 0;
}
Previous Article

Define class Event

Next Article

Define Class Student

Write a Comment

Leave a Comment

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