I have written a simple C program which takes input from the user using code similar to the following:
printf("Please enter number one: ");
scanf("%i", &numberOne);
printf("Please enter number two: ");
scanf("%i", &numberTwo);
...
This all works fine when the program is run - the user is prompted for input, with each input prompt appearing on a separate line (presumably because the user hits the Return key to indicate they have finished entering their input on the previous line). For example:
Please enter number one:
Please enter number two:
However, when I redirect a text file into the program as the input (for testing) using ./myProgram < inputText.txt all the input prompts appear on a single line, I am guessing because there is no Return key being pressed since all the inputs come from the text file:
Please enter number one: Please enter number two:
Is it possible for the prompts to appear each on their own line?
Thanks for any help!