FastFoodCoding

Login


Connect with one of the following accounts





Login

Please wait while we redirect...

Views: 167   



Relational operators used to compare values in C Language. Following are the relational operators available.

Operator Description
< Less than
<= Less than or equal
> Greater than
>= Greater than or equal
== Equal
!= Not equal
#include <stdio.h>

int main() {
    int a = 10;
    int b = 5;

    if(a < b){
        printf("a less than b \n");
    }

    if(a <= b){
        printf("a less than or equal to b \n");
    }

    if(a > b){
        printf("a greater than b \n");
    }

    if(a >= b){
        printf("a greater than equal b \n");
    }

    if(a == b){
        printf("a is equal to b \n");
    }

    if(a != b){
        printf("a is not equal to b \n");
    }
}

Output:

a greater than b
a greater than equal b
a is not equal to b



On By


Top Tutorials

Top Questions

Top Articles

Top Blogs

Top News