fork download
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <math.h>
  4.  
  5. int main(void) {
  6. for (int x = 1; x < 13; x++) {
  7. printf("%2d %3d %lf\n", x, x * x, sqrt(x));
  8. if (x % 3 == 0) {
  9. puts("---------------");
  10. }
  11. }
  12. return EXIT_SUCCESS;
  13. }
  14.  
Success #stdin #stdout 0s 5352KB
stdin
Standard input is empty
stdout
 1   1 1.000000
 2   4 1.414214
 3   9 1.732051
---------------
 4  16 2.000000
 5  25 2.236068
 6  36 2.449490
---------------
 7  49 2.645751
 8  64 2.828427
 9  81 3.000000
---------------
10 100 3.162278
11 121 3.316625
12 144 3.464102
---------------