fork(1) download
  1. #include <stdio.h>
  2. #include <math.h>
  3.  
  4. int main() {
  5.  
  6. int x;
  7. printf("x x^2 x^4 cube root of x\n");
  8. for (x = 0; x < 101; x = x + 2) {
  9. if (x == 0)
  10. printf("%d %d %d %f\n", x, x*x, x*x*x*x, cbrt(x));
  11. if (x == 2)
  12. printf("%d %d %d %f\n", x, x*x, x*x*x*x, cbrt(x));
  13. if (x == 4)
  14. printf("%d %d %d %f\n", x, x*x, x*x*x*x, cbrt(x));
  15. if (x > 4 && x < 10)
  16. printf("%d %d %d %f\n", x, x*x, x*x*x*x, cbrt(x));
  17. if (x > 8 && x < 18)
  18. printf("%d %d %d %f\n", x, x*x, x*x*x*x, cbrt(x));
  19. if (x > 16 && x < 32)
  20. printf("%d %d %d %f\n", x, x*x, x*x*x*x, cbrt(x));
  21. if (x > 30 && x < 58)
  22. printf("%d %d %d %f\n", x, x*x, x*x*x*x, cbrt(x));
  23. if (x > 56 && x < 100)
  24. printf("%d %d %d %f\n", x, x*x, x*x*x*x, cbrt(x));
  25. if (x == 100)
  26. printf("%d %d %d %f\n", x, x*x, x*x*x*x, cbrt(x));
  27. }
  28. }
Success #stdin #stdout 0s 2112KB
stdin
Standard input is empty
stdout
x  x^2  x^4  cube root of x
0   0    0      0.000000
2   4    16     1.259921
4   16   256    1.587401
6   36   1296   1.817121
8   64   4096   2.000000
10  100  10000  2.154435
12  144  20736  2.289428
14  196  38416  2.410142
16  256  65536  2.519842
18  324  104976 2.620741
20  400  160000 2.714418
22  484  234256 2.802039
24  576  331776 2.884499
26  676  456976 2.962496
28  784  614656 3.036589
30  900  810000 3.107233
32  1024 1048576 3.174802
34  1156 1336336 3.239612
36  1296 1679616 3.301927
38  1444 2085136 3.361975
40  1600 2560000 3.419952
42  1764 3111696 3.476027
44  1936 3748096 3.530348
46  2116 4477456 3.583048
48  2304 5308416 3.634241
50  2500 6250000 3.684031
52  2704 7311616 3.732511
54  2916 8503056 3.779763
56  3136 9834496 3.825862
58  3364 11316496 3.870877
60  3600 12960000 3.914868
62  3844 14776336 3.957892
64  4096 16777216 4.000000
66  4356 18974736 4.041240
68  4624 21381376 4.081655
70  4900 24010000 4.121285
72  5184 26873856 4.160168
74  5476 29986576 4.198336
76  5776 33362176 4.235824
78  6084 37015056 4.272659
80  6400 40960000 4.308869
82  6724 45212176 4.344481
84  7056 49787136 4.379519
86  7396 54700816 4.414005
88  7744 59969536 4.447960
90  8100 65610000 4.481405
92  8464 71639296 4.514357
94  8836 78074896 4.546836
96  9216 84934656 4.578857
98  9604 92236816 4.610436
100 10000 100000000 4.641589