fork download
  1. #include <stdio.h>
  2.  
  3.  
  4. double max(double x, double y);
  5. double abs(double x);
  6. double cube(double x);
  7.  
  8.  
  9. int main(void){
  10. double a, b;
  11. a = -3.2;
  12. b = 1.4;
  13.  
  14. printf("max(|%.2f|,(%.2f)^3) = %.2f\n",
  15. a, b, max(abs(a), cube(b)));
  16.  
  17. return 0;
  18. }
  19.  
  20. double max(double x, double y){
  21. return (x > y) ? x : y;
  22. }
  23. \
  24. double abs(double x){
  25. return (x > 0) ? x : -x;
  26. }
  27.  
  28.  
  29. double cube(double x){
  30. return x * x * x;
  31. }
Success #stdin #stdout 0s 5268KB
stdin
Standard input is empty
stdout
max(|-3.20|,(1.40)^3) = 3.20