Header Ads Widget

Relational Operators

Relational operators are used to compare values of two expressions depending on their relationship. If the relation is true then it gives 1, otherwise it gives 0. 
Relational operators have lower precedence than arithmetic operators. Consider expression like   x < y -5 .   It is taken as     x < ( y - 5 ).

Example :

int main( )
{
int a = 5, b = 6;
printf( "%d", (a > b));
printf( "%d", (a < b));
printf( "%d", (a != b));
printf( "%d", (a == b));
printf( "%d", (a >= b));
return 0;
}


Post a Comment

0 Comments