1. Course
  2. Functions A
  3. Function to write format text

Function to write format text


Last updated: 8/23/2020 Difficulty: Intermediate

Create a program in C# that implements a function called WriteCenteredUnderline that receives as a parameter a text requested from the user. Then show the text centered and underlined using the '-' character on the screen, assuming we have 80 spaces wide.

Input

Hello

Output

                                     Hello
                                     -----

Solution

Functions A

5 / 9

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