The Question is : Write a program that reads a String from the keyboard. The program then creates a file named: xx.txt (replace xx with the String that is read from keyboard).
Your program will read the above file and display the first five lines of the file in reverse order; i.e.,
Line #five
Line #four
Line #three
Line #two
Line #one
If the file has more than five lines, it will print ONLY the first five lines in the reverse order. If the file has less than five lines then these should be displayed as it appears in the file (NOT reversed).
I Only want to know the first step
How can I create a file and rename it by the keyboard??
Your program will read the above file and display the first five lines of the file in reverse order; i.e.,
Line #five
Line #four
Line #three
Line #two
Line #one
If the file has more than five lines, it will print ONLY the first five lines in the reverse order. If the file has less than five lines then these should be displayed as it appears in the file (NOT reversed).
I Only want to know the first step
How can I create a file and rename it by the keyboard??