C Operators

Realational operators

    void main()
       int a,b;
	printf("Enter the First No:");
	printf("Enter the Second No:");
		 printf("%d is the Greater No.",a);
	else if
		printf("%d is the Greater No.",b);
     else if
    	printf("Eqal No.s")

A simple relational expression contains only one relational operator and takes the following form.
exp1 relational operator exp2
Where exp1 and exp2 are expressions, which may be simple constants, variables or combination of them. Given below is a list of examples of relational expressions and evaluated values.
6.5 <= 25 TRUE
-65 > 0 FALSE
10 < 7 + 5 TRUE
	Operator		Meaning
	<			is less than
	<=			is less than or equal to
	>			is greater than
	>=			is greater than or equal to
	==			is equal to != is not equal to	    

Often it is required to compare the relationship between operands and bring out a decision and program accordingly.
This is when the relational operator come into picture.
C supports the following relational operators.
It is required to compare the marks of 2 students, salary of 2 persons, we can compare them using relational operators.
Relational expressions are used in decision making statements of C language such as if, while and for statements to decide the course of action of a running program.

Make Comments..!!

Oops!! No posts from user.

Download Android App