C Operators

Realational operators


	#include'stdio.h'
    void main()
     {
       int a,b;
	clrscr();
	printf("Enter the First No:");
	Scanf("%d",&a);
	printf("Enter the Second No:");
	Scanf("%d",&b);
	If(a>b)
	{
		 printf("%d is the Greater No.",a);
	}
	else if
	{ 
		printf("%d is the Greater No.",b);
    }
     else if
	{   
    	printf("Eqal No.s")
	}
    getch();
  }

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