Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Displaying Output | Getting Started
course content

Зміст курсу

C# Basics

Displaying OutputDisplaying Output

We can use the System.Console.WriteLine method to display some text in the console. Following is the syntax for doing that:

cs

main.cs

Note that we enclose the text in double-quotes ("). In C#, any textual data is always enclosed in double-quotation marks.

Following is a program which outputs a sentence in the console:

cs

main.cs

The System.Console.WriteLine method automatically shifts the cursor to the next line so if we use System.Console.WriteLine again, the text will be outputted in a new line.

cs

main.cs

Another method for outputting messages in the console is System.Console.Write. It is similar to the System.Console.WriteLine method. However, it does not shift the cursor to the next line.

cs

main.cs

The difference between the two methods might become more clear with an example:

cs

main.cs

question-icon

Complete the code:

.()
Output Text

Натисніть або перетягніть елементи та заповніть пропуски

Все було зрозуміло?

Секція 1. Розділ 3
course content

Зміст курсу

C# Basics

Displaying OutputDisplaying Output

We can use the System.Console.WriteLine method to display some text in the console. Following is the syntax for doing that:

cs

main.cs

Note that we enclose the text in double-quotes ("). In C#, any textual data is always enclosed in double-quotation marks.

Following is a program which outputs a sentence in the console:

cs

main.cs

The System.Console.WriteLine method automatically shifts the cursor to the next line so if we use System.Console.WriteLine again, the text will be outputted in a new line.

cs

main.cs

Another method for outputting messages in the console is System.Console.Write. It is similar to the System.Console.WriteLine method. However, it does not shift the cursor to the next line.

cs

main.cs

The difference between the two methods might become more clear with an example:

cs

main.cs

question-icon

Complete the code:

.()
Output Text

Натисніть або перетягніть елементи та заповніть пропуски

Все було зрозуміло?

Секція 1. Розділ 3
some-alt