Mode:
Duration:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
using System;
using System.Collections.Generic;
class Program
{
static void Main()
{
// for loop
for (int i = 1; i <= 5; i++)
{
if (i == 3)
continue;
Console.WriteLine("For: " + i);
}
// while loop
int j = 1;
while (j <= 5)
{
if (j == 4)
break;
Console.WriteLine("While: " + j);
j++;
}
// do-while loop
int k = 1;
do
{
Console.WriteLine("DoWhile: " + k);
k++;
} while (k <= 3);
// foreach loop
List<string> items = new List<string> { "A", "B", "C" };
foreach (string item in items)
{
Console.WriteLine("Foreach: " + item);
}
}
}Coding works best on desktop or with an external keyboard.