fork(1) download
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4. double pi = 3.1415926;
  5.  
  6. printf("f\t %f\n", pi);
  7. //%f 3.141593
  8.  
  9. printf(".5f\t %.5f\n", pi);
  10. //%.5f 3.14159
  11.  
  12. printf(".3f\t %.3f\n", pi);
  13. //%.3f 3.142
  14.  
  15. printf(".0f\t %.0f\n", pi);
  16. //%.0f 3
  17. return 0;
  18. }
  19.  
Success #stdin #stdout 0s 5324KB
stdin
Standard input is empty
stdout
f	 3.141593
.5f	 3.14159
.3f	 3.142
.0f	 3