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
44
45
46
47
48
49
50
51
52
using System;
class Program
{
static void ModifyValue(int x)
{
x = x + 10;
}
static void ModifyRef(ref int x)
{
x = x + 10;
}
static void GetValues(out int a, out int b)
{
a = 10;
b = 20;
}
static int Sum(params int[] numbers)
{
int total = 0;
foreach (int n in numbers)
total += n;
return total;
}
static void Display(string name = "Guest")
{
Console.WriteLine("Hello " + name);
}
static void Main()
{
int num = 5;
ModifyValue(num);
Console.WriteLine("Value Parameter: " + num);
ModifyRef(ref num);
Console.WriteLine("Ref Parameter: " + num);
int a, b;
GetValues(out a, out b);
Console.WriteLine($"Out Parameters: {a}, {b}");
Console.WriteLine("Params Sum: " + Sum(1, 2, 3, 4));
Display();
Display("Alice");
}
}Coding works best on desktop or with an external keyboard.