1. Course
  2. Text Files B
  3. More program

More program


Last updated: 8/23/2020 Difficulty: Intermediate

Create a C# program that behaves like the Unix more command, you must display the contents of a text file and ask the user to press Enter every time the screen is full.

As a simple method, you can display truncated lines at 79 characters and stop after every 24 lines.

Input

Output

Lorem ipsum dolor sit amet consectetur adipiscing elit nulla commodo facilisis.
Est litora vitae imperdiet senectus sed purus lacus fermentum libero.
Odio faucibus nibh massa per euismod etiam netus nunc. Mus ad aliquam non
fermentum eu libero eros nullam varius curabitur, ligula et sem sapien eget fri
convallis nostra suscipit, metus egestas curae penatibus potenti fames urna
vulputate himenaeos. Venenatis dapibus congue quis aptent tincidunt vivamus
hendrerit litora purus, sollicitudin vestibulum malesuada fusce urna neque luct

Curabitur netus dictum in mollis bibendum auctor ante, molestie suspendisse hab
nostra tempor eu facilisi, nulla quam potenti integer aenean nisi. Litora vivam
euismod justo sociis malesuada aliquet leo pretium nullam ullamcorper vitae nos
dis facilisis vehicula, taciti molestie semper aliquam aptent fermentum maecena
felis commodo blandit neque dui dapibus donec. Id erat curabitur sem dapibus er
feugiat per phasellus enim class mauris auctor, tortor magnis nisi vivamus veli
Curabitur netus dictum in mollis bibendum auctor ante, molestie suspendisse hab
nostra tempor eu facilisi, nulla quam potenti integer aenean nisi. Litora vivam
euismod justo sociis malesuada aliquet leo pretium nullam ullamcorper vitae nos
dis facilisis vehicula, taciti molestie semper aliquam aptent fermentum maecena
felis commodo blandit neque dui dapibus donec. Id erat curabitur sem dapibus er
feugiat per phasellus enim class mauris auctor, tortor magnis nisi vivamus veli

Lorem ipsum dolor sit amet consectetur adipiscing elit nulla commodo facilisis.
Est litora vitae imperdiet senectus sed purus lacus fermentum libero.
Odio faucibus nibh massa per euismod etiam netus nunc. Mus ad aliquam non

Press Enter to continue...

Solution

Text Files B

5 / 5

Android App


Practice C# anywhere with the free app for Android devices.

Android App

Exercises C# by difficulty


Learn C# at your own pace, the exercises are ordered by difficulty.

Make a donation


Your donations support our work and contribute to the maintenance of the app.

Advertising