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