×
☰ Menu

Relational Operators

We often compare two quantities depending on their relation and take certain decisions.

 

 

Relational Operators

Operator

Meaning

< is less than
<= is less than or equal to
> is greater than
>= is greater than
!= is not equal to

 

Code: 

#include <stdio.h>

main() 
{

   int a = 21, b=10, c;

   c=(a>b);
printf("%d\n", c );
	c=(a<b);
printf("%d\n", c );	

}

Output: 

1
0

--------------------------------
Process exited after 4.931 seconds with return value 0
Press any key to continue . . .