fork download
  1. #include <stdio.h>
  2.  
  3. int main() {
  4. int a, b;
  5.  
  6. // Input two numbers from the user
  7. printf("Enter the first number (a): ");
  8. scanf("%d", &a);
  9. printf("Enter the second number (b): ");
  10. scanf("%d", &b);
  11.  
  12. // Using relational operators
  13. printf("\nRelational Operations:\n");
  14. printf("%d > %d : %d\n", a, b, a > b); // Greater than
  15. printf("%d < %d : %d\n", a, b, a < b); // Less than
  16. printf("%d >= %d : %d\n", a, b, a >= b); // Greater than or equal to
  17. printf("%d <= %d : %d\n", a, b, a <= b); // Less than or equal to
  18. printf("%d == %d : %d\n", a, b, a == b); // Equal to
  19. printf("%d != %d : %d\n", a, b, a != b); // Not equal to
  20.  
  21. return 0;
  22. }
Success #stdin #stdout 0s 5292KB
stdin
Standard input is empty
stdout
Enter the first number (a): Enter the second number (b): 
Relational Operations:
0 > 4198736  : 0
0 < 4198736  : 1
0 >= 4198736 : 0
0 <= 4198736 : 1
0 == 4198736 : 0
0 != 4198736 : 1