Quantcast
Channel: Programming Forums
Viewing all articles
Browse latest Browse all 51036

How can I print a file in the reverse order?

$
0
0
I have a text file and i need to print the lines in the reverse order

THE QUESTION: 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).


This is the text File
Line #one
Line #two 
Line #three
Line #four
Line #five

Viewing all articles
Browse latest Browse all 51036

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>