fork(4) download
  1. #include <stdio.h>
  2.  
  3. #define MINIMUM2(a,b) (a < b ? a:b)
  4. #define MINIMUM3(a,b,c) (MINIMUM2(MINIMUM2(a,b),c))
  5.  
  6. int main (void) {
  7. int x,y,z;
  8. int temp;
  9. printf("Please enter three numbers\n");
  10. scanf("%d%d%d", &x, &y, &z);
  11. temp = MINIMUM3(x, y, z);
  12. printf("The smallest number entered is:\n");
  13. printf("%d", temp);
  14. return 0;
  15. }
  16.  
Success #stdin #stdout 0s 2012KB
stdin
10 2 18
stdout
Please enter three numbers
The smallest number entered is:
2