Tahamina_Taha

All relational operators

Feb 5th, 2017
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.04 KB | None | 0 0
  1. #include<stdio.h>
  2. #include<math.h>
  3. // All   relational operators which used  for decision making and loops.
  4. int main()
  5. {
  6. /* A relational operator checks the relationship between two operands.
  7. If the relation is true, it returns 1;
  8. if the relation is false, it returns value 0.*/
  9.     int a,b,c;
  10.     printf(" Enter value of a b c: \n");
  11.     scanf("%d %d %d",&a,&b,&c);
  12.  
  13.     printf("%d == %d is %d \n", a, b, a == b);//Equal to
  14.     printf("%d == %d is %d \n", a, c, a == c);
  15.     printf("%d > %d is %d \n", a, b, a > b);//greater than
  16.     printf("%d > %d is %d \n", a, c, a > c);
  17.     printf("%d < %d is %d \n", a, b, a < b);//less than
  18.     printf("%d < %d is %d \n", a, c, a < c);
  19.     printf("%d != %d is %d \n", a, b, a != b);//not equal to
  20.     printf("%d != %d is %d \n", a, c, a != c);
  21.     printf("%d >= %d is %d \n", a, b, a >= b);//greater than or equal
  22.     printf("%d >= %d is %d \n", a, c, a >= c);
  23.     printf("%d <= %d is %d \n", a, b, a <= b);//less than or equal
  24.     printf("%d <= %d is %d \n", a, c, a <= c);
  25.  
  26.      return 0;
  27.      }
Add Comment
Please, Sign In to add comment