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