Relational Operators example in C Language
Relational Operators example Program :
-
#include<stdio.h>
-
int main(void)
-
{
-
int a,b ;
-
printf(“Enter values for a and b : “);
-
scanf(“%d%d”,&a,&b);
-
-
if(a<b)
-
printf(“%d is less than %dn“,a,b);
-
if(a<=b)
-
printf(“%d is less than or equal to %dn“,a,b);
-
if(a==b)
-
printf(“%d is equal to %dn“,a,b);
-
if(a!=b)
-
printf(“%d is not equal to %dn“,a,b);
-
if(a>b)
-
printf(“%d is greater than %dn“,a,b);
-
if(a>=b)
-
printf(“%d is greater than or equal to %dn“,a,b);
-
return 0;
-
}
Output :
Enter values for a and b : 20 10
20 is not equal to 10
20 is greater than 10
20 is greater than or equal to 10