fork download
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. int main(void) {
  5. float a = 3;
  6. int b = 5;
  7.  
  8. char tmp[10];
  9. sprintf(tmp, "%fe%d", a, b);
  10.  
  11. double x = atof(tmp);
  12. printf("x = %fe%d = %f\n", a, b, x);
  13. return 0;
  14. }
  15.  
Success #stdin #stdout 0s 2292KB
stdin
Standard input is empty
stdout
x = 3.000000e5 = 300000.000000