Avoid using 'scanf()'. This function, when used improperly, does not consider buffer boundaries and can lead to buffer overflows. Use 'fgets()' instead for reading input.
scanf("%s",file_name);//comment this line if you dont want the filename prompt