C examples for Operator:Relational Operator
The comparison operators compare two values and return either true or false, represented as 1 or 0.
#include <stdio.h> int main(void) { int x = (2 == 3); /* 0 - equal to */ x = (2 != 3); /* 1 - not equal to */ x = (2 > 3); /* 0 - greater than */ x = (2 < 3); /* 1 - less than */ x = (2 >= 3); /* 0 - greater than or equal to */ x = (2 <= 3); /* 1 - less than or equal to */ }