fork download
  1. #include <stdio.h>
  2. #include <math.h>
  3.  
  4. #define MAX 100
  5.  
  6. void xydvimatis(float xy[MAX][MAX], float xnuo, float xiki);
  7.  
  8. int main()
  9. {
  10. float xy[MAX][MAX];
  11. float xnuo = -4;
  12. float xiki = 4;
  13. xydvimatis(xy, xnuo, xiki);
  14. return 0;
  15. }
  16.  
  17. void xydvimatis(float xy[MAX][MAX], float xnuo, float xiki)
  18. {
  19. int i;
  20. float x = xnuo;
  21. for (i = 0; x <= xiki; i++)
  22. {
  23. xy[i][0] = -pow(x, 4) + 3 * pow(x, 3) + 2 * pow(x, 2) - 5 * (x)+0.5;
  24. printf("%0.1f \n", x);
  25. x = x + 0.1;
  26. }
  27. }
  28.  
Success #stdin #stdout 0s 9424KB
stdin
Standard input is empty
stdout
-4.0 
-3.9 
-3.8 
-3.7 
-3.6 
-3.5 
-3.4 
-3.3 
-3.2 
-3.1 
-3.0 
-2.9 
-2.8 
-2.7 
-2.6 
-2.5 
-2.4 
-2.3 
-2.2 
-2.1 
-2.0 
-1.9 
-1.8 
-1.7 
-1.6 
-1.5 
-1.4 
-1.3 
-1.2 
-1.1 
-1.0 
-0.9 
-0.8 
-0.7 
-0.6 
-0.5 
-0.4 
-0.3 
-0.2 
-0.1 
-0.0 
0.1 
0.2 
0.3 
0.4 
0.5 
0.6 
0.7 
0.8 
0.9 
1.0 
1.1 
1.2 
1.3 
1.4 
1.5 
1.6 
1.7 
1.8 
1.9 
2.0 
2.1 
2.2 
2.3 
2.4 
2.5 
2.6 
2.7 
2.8 
2.9 
3.0 
3.1 
3.2 
3.3 
3.4 
3.5 
3.6 
3.7 
3.8 
3.9 
4.0