C examples for Operator:Relational Operator
Evaluating relational expressions.
#include <stdio.h> int a;/*from ww w . j a va 2 s . com*/ int main( void ) { a = (5 == 5); /* a is 1 */ printf("\na = (5 == 5)\na = %d", a); a = (5 != 5); /* a is 0 */ printf("\na = (5 != 5)\na = %d", a); a = (12 == 12) + (5 != 1); /* Evaluates to 1 + 1 */ printf("\na = (12 == 12) + (5 != 1)\na = %d\n", a); return 0; }