23
1
using System;
2
3
public class BasicIO
4
{
5
public static void Main()
6
{
7
//string array containing lines
8
string[] lines = { "This is the first line.",
9
"This is the second line." };
10
// Output the lines using the default newline sequence.
11
Console.WriteLine("With the default new line characters:");
12
13
//add a line break
14
Console.WriteLine();
15
//loop through each line using foreach loop
16
foreach (string line in lines)
17
{
18
Console.WriteLine(line);
19
}
20
21
Console.WriteLine();
22
}
23
}
Cached Result
With the default new line characters:
This is the first line.
This is the second line.
This is the first line.
This is the second line.