-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
42 lines (29 loc) · 913 Bytes
/
Program.cs
File metadata and controls
42 lines (29 loc) · 913 Bytes
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
using System;
using System.Collections.Generic;
namespace MyApp // Note: actual namespace depends on the project name.
{
internal class Program
{
static void Main(string[] args)
{
List<string> names = new List<string>();
names.Add("Bob");
names.Add("Anne");
names.Add("Daphne");
names.Add("Steve");
names.Add("Seth");
names.ForEach(name => Console.Write(name + " "));
List<string> stuff = new List<string>{"a", "b", "c", "d"};
stuff.ForEach(stuff => Console.Write(stuff + " "));
int x = 5;
int y = 7;
int result = Adder(x,y);//12
int result2=Adder(10,46);//56
Console.WriteLine($"{x} + {y} = {result}");
}
static int Adder(int a, int b)
{
return a + b;
}
}
}