fork download
  1. #include <stdio.h>
  2.  
  3. int main()
  4. {
  5. char s[64];
  6. double d = 0.0;
  7.  
  8. printf("Enter a number, then hit enter:\r\n");
  9. scanf("%lf", &d);
  10.  
  11. printf("Now, enter any string:\r\n");
  12. scanf("%63s", s);
  13.  
  14. printf("\r\nThe number you entered was:\r\n"
  15. " %lf\r\nand the string you entered was:\r\n"
  16. " %s\r\n", d, s);
  17.  
  18. return 0;
  19. }
Success #stdin #stdout 0.01s 2728KB
stdin
123.45e-1hello
world!
stdout
Enter a number, then hit enter:
Now, enter any string:

The number you entered was:
  12.345000
and the string you entered was:
  hello