fork(2) download
  1. #include <stdio.h>
  2.  
  3. int main(void)
  4. {
  5. int digits = 4;
  6. printf("%0.*g\n", digits, 0.123456789);
  7. printf("%0.*g\n", digits, 5.9);
  8.  
  9. return 0;
  10. }
Success #stdin #stdout 0s 2168KB
stdin
Standard input is empty
stdout
0.1235
5.9