Write a C program to understand the use of relational operators
- Yatendra Awana
- Jul 21, 2021
- 1 min read
#include<stdio.h>
void main()
{
int x,y ;
printf("Enter values for x and y : ");
scanf("%d%d",&x,&y);
if(x<y)
printf("%d is less than %d\n",x,y);
if(x<=y)
printf("%d is less than or equal to %d\n",x,y);
if(x==y)
printf("%d is equal to %d\n",x,y);
if(x!=y)
printf("%d is not equal to %d\n",x,y);
if(x>y)
printf("%d is greater than %d\n",x,y);
if(x>=y)
printf("%d is greater than or equal to %d\n",x,y);
getch();
}
Comments