Arithmetic Comparisons and Relational Operators - C Operator

C examples for Operator:Relational Operator

Introduction

OperatorComparison
< Is the left operand less than the right operand
<= Is the left operand less than or equal to the right operand
== Is the left operand equal to the right operand
!= Is the left operand not equal to the right operand
> Is the left operand greater than the right operand
>= Is the left operand greater than or equal to the right operand

Any nonzero numerical value will result in true when it is converted to type bool.

Demo Code

#include <stdio.h> 
#include <stdbool.h> 
int main(void) { 
    //ww w .  j  a v a 2  s.  co m
  bool result = 5 < 4;                        // result will be false
  
  printf("%d",result);
  
  return 0; 
}

Result


Related Tutorials