Relational operators:
- These operator returns true(1) or false(0) by validating the relation among the data.
- Operators are >, <, >=, <=, ==, !=
#include<stdio.h> int main() { printf(“5>3 : %d \n”, 5>3); printf(“5<3 : %d \n”, 5<3); printf(“5==3 : %d \n”, 5==3); printf(“5!=3 : %d \n”, 5!=3); return 0; } |
Condition to check the number is Positive
N>=0
Condition to check the number is equal to zero
N==0
Condition to check the 2 numbers equal
A==B
Condition to check First Num greater than Second Num
A>B
Square of First Number not equals to Second Number
A!=B
Condition to check sum of 2 numbers equal to 10
A+B==10
Condition to check the number divisible by 3
N%3==0
Condition to check the number is Even
N%2==0
Condition to check the last digit of Number is 0
N%10==0
Condition to check the last digit of Number is Even
N%10%2==0
Condition to check the multiplication of 2 numbers not equals to 3rd number
A*B==C
Condition to check average of 4 subjects marks greater than 60
(A+B+C+D)/4>60
Condition to check the sum of First 2 numbers equals to last digit of 3rd number
A+B == C%10
Condition to check average of 3 numbers equals to first number
(A+B+C)/3==A
Condition to check the given quantity of fruits exactly in dozens
A%12==0
Condition to person is eligible for Vote
AGE>=18