/* Comparison.c: arithmetic comparisons */ /* */ /* author: Rainer Doemer */ /* */ /* modifications: */ /* 10/07/04 RD initial version */ #include /* main function */ int main(void) { /* variable definitions */ int a, b; /* input section */ printf("Please enter a value for integer a: "); scanf("%d", &a); printf("Please enter a value for integer b: "); scanf("%d", &b); /* computation and output section */ if (a == b) { printf("%d is equal to %d.\n", a, b); } /* fi */ if (a != b) { printf("%d is not equal to %d.\n", a, b); } /* fi */ if (a < b) { printf("%d is less than %d.\n", a, b); } /* fi */ if (a > b) { printf("%d is greater than %d.\n", a, b); } /* fi */ if (a <= b) { printf("%d is less than or equal to %d.\n", a, b); } /* fi */ if (a >= b) { printf("%d is greater than or equal to %d.\n", a, b); } /* fi */ /* exit */ return 0; } /* end of main */ /* EOF */