fork download
  1. #include <stdio.h>
  2. #include <math.h>
  3.  
  4. int main ()
  5. {
  6. float a,x;
  7. float y;
  8. printf ("enter var a,x: ");
  9. scanf("%f %f", &a, &x);
  10. if (x<-4)
  11. y=a*x+sin(x);
  12. else
  13. if (x>=0)
  14. y=sin(a*x)-sqrt(x);
  15. else
  16. y=x+cos(x);
  17. printf ("x,y %f %f\n", x, y);
  18. return 0;
  19. }
  20.  
Success #stdin #stdout 0s 2296KB
stdin
0.5 0.14
stdout
enter var a,x: x,y 0.140000 -0.304223