google407ec42f1ae5ff0e.html Write a C program to understand the use of relational operators
top of page

Write a C program to understand the use of relational operators


#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();

}


7 views0 comments

Recent Posts

See All
bottom of page