fork(1) download
  1. #include <stdio.h>
  2.  
  3. int main(int argc, char* argv[])
  4. {
  5. double a = 3.0 / 7.0;
  6.  
  7. printf("%.3f\n", a);
  8.  
  9. for (int i = 0 ; i < 8 ; ++i) {
  10. printf("%.*f\n", i, a);
  11. }
  12.  
  13. return 0;
  14. }
  15.  
Success #stdin #stdout 0s 2852KB
stdin
Standard input is empty
stdout
0.429
0
0.4
0.43
0.429
0.4286
0.42857
0.428571
0.4285714