fork download
  1. #include <stdio.h>
  2. #include <string.h>
  3.  
  4. #define MAX_NAME 40
  5. int main() {
  6. char name[MAX_NAME+5];
  7. printf("Type name of program: ");
  8. scanf("%40s", name);
  9. strcat(name, ".txt");
  10. puts(name);
  11. return 0;
  12. }
  13.  
Success #stdin #stdout 0s 10320KB
stdin
hello
stdout
Type name of program: hello.txt