The following table shows all relation operators supported by C.
Operator | Description |
---|---|
== | Check if two operand are equal |
!= | Check if two operand are not equal. |
> | Check if operand on the left is greater than operand on the right |
< | Check operand on the left is smaller than right operand |
>= | check left operand is greater than or equal to right operand |
<= | Check if operand on left is smaller than or equal to right operand |
//Write a C Program Which use of Relation Operators.
#include<stdio.h>
#include<conio.h>
void main()
{
int mark;
clrscr();
printf("Enter Mark: ");
scanf("%d",&mark);
if (mark==100)
printf("Superb :-)");
else if (mark>=60)
printf("First Class");
else if (mark>=35)
printf("Second Class");
else if (mark<35)
printf("Fail");
getch();
}
Ask Question