C Relational operators

Description

Relational operators are used to compare values.

Syntax

The following list has the relational operators that you use to compare values:

Operator Meaning
< is less than
== is equal to
> is greater than
>= is greater than or equal to
<= is less than or equal to
!= is not equal to

Example


#include <stdio.h>
/* w  w  w  .j a  va2  s.co m*/
main(){
  int i = 3,j = 5;
  if(i < j){
     printf("i < j \n");
  }   
}

The code above generates the following result.





















Home »
  C Language »
    Language Basics »




C Language Basics
Data Types
Operator
Statement
Array