text: Operators in C | Set 2 ( Relational and Logical Operators ) | C program to demonstrate working of relational operators ; greater than example ; greater than equal to ; less than example ; lesser than equal to ; equal to ; not equal to
code: #include <stdio.h> NEW_LINE int main ( ) { int a = 10 , b = 4 ; if ( a > b ) printf ( " a ▁ is ▁ greater ▁ than ▁ b STRNEWLINE " ) ; else printf ( " a ▁ is ▁ less ▁ than ▁ or ▁ equal ▁ to ▁ b STRNEWLINE " ) ; if ( a >= b ) printf ( " a ▁ is ▁ greater ▁ than ▁ or ▁ equal ▁ to ▁ b STRNEWLINE " ) ; else printf ( " a ▁ is ▁ lesser ▁ than ▁ b STRNEWLINE " ) ; if ( a < b ) printf ( " a ▁ is ▁ less ▁ than ▁ b STRNEWLINE " ) ; else printf ( " a ▁ is ▁ greater ▁ than ▁ or ▁ equal ▁ to ▁ b STRNEWLINE " ) ; if ( a <= b ) printf ( " a ▁ is ▁ lesser ▁ than ▁ or ▁ equal ▁ to ▁ b STRNEWLINE " ) ; else printf ( " a ▁ is ▁ greater ▁ than ▁ b STRNEWLINE " ) ; if ( a == b ) printf ( " a ▁ is ▁ equal ▁ to ▁ b STRNEWLINE " ) ; else printf ( " a ▁ and ▁ b ▁ are ▁ not ▁ equal STRNEWLINE " ) ; if ( a != b ) printf ( " a ▁ is ▁ not ▁ equal ▁ to ▁ b STRNEWLINE " ) ; else printf ( " a ▁ is ▁ equal ▁ b STRNEWLINE " ) ; return 0 ; }