fork download
  1. // always print 0 or 1 value
  2.  
  3. #include <stdio.h>
  4.  
  5. int main() {
  6. int a = 10, b = 20;
  7.  
  8. printf("a = %d, b = %d\n\n", a, b);
  9.  
  10. // Greater than
  11. printf("a > b: %d\n", a > b);
  12.  
  13. // Less than
  14. printf("a < b: %d\n", a < b);
  15.  
  16. // Greater than or equal to
  17. printf("a >= b: %d\n", a >= b);
  18.  
  19. // Less than or equal to
  20. printf("a <= b: %d\n", a <= b);
  21.  
  22. // Equal to
  23. printf("a == b: %d\n", a == b);
  24.  
  25. // Not equal to
  26. printf("a != b: %d\n", a != b);
  27.  
  28. return 0;
  29. }
  30.  
Success #stdin #stdout 0s 5288KB
stdin
Standard input is empty
stdout
a = 10, b = 20

a > b: 0
a < b: 1
a >= b: 0
a <= b: 1
a == b: 0
a != b: 1