Relational operators

Relational operators are important for making decisions. They allow us compare numeric and char (chars are treated like numbers in C++) values to determine if one is greater than, less than, equal to, or not equal to another.

Relational operators are binary meaning they require two operands.

Relational operators have left to right associativity. Left to right associativity means that when two operators of same precedence are adjacent, the left most operator is evaluated first.



1.Write a Program to perform Relational Operators Operations.

#include<stdio.h>

void main()

{

    int a;

    printf("Enter the Number=");

    scanf("%d",&a);

    printf("%d\n",a==25);

    printf("%d\n",a!=25);

    printf("%d\n",a<25);

    printf("%d\n",a>25);

    printf("%d\n",a<=25);

    printf("%d\n",a>=25);

}

Output: