diff --git a/CSahrp/break.cs b/CSahrp/break.cs new file mode 100644 index 0000000..2450e2b --- /dev/null +++ b/CSahrp/break.cs @@ -0,0 +1,10 @@ +class BREAK +{ + public BREAK() + { + const bool flag = true; + Console.WriteLine("Hello"); + if (flag) break; + Console.WriteLine("World"); + } +} \ No newline at end of file diff --git a/CSahrp/continue.cs b/CSahrp/continue.cs new file mode 100644 index 0000000..e71145a --- /dev/null +++ b/CSahrp/continue.cs @@ -0,0 +1,10 @@ +class BREAK +{ + public BREAK() + { + const bool flag = true; + Console.WriteLine("Hello"); + if (flag) continue; + Console.WriteLine("World"); + } +} \ No newline at end of file diff --git a/CSahrp/doWhile.cs b/CSahrp/doWhile.cs new file mode 100644 index 0000000..3003ce0 --- /dev/null +++ b/CSahrp/doWhile.cs @@ -0,0 +1,11 @@ +class WHILE +{ + public WHILE() + { + int i = 0; + do + { + Console.WriteLine(i++); + } while (i < 10); + } +} \ No newline at end of file diff --git a/CSahrp/for.cs b/CSahrp/for.cs new file mode 100644 index 0000000..08545cb --- /dev/null +++ b/CSahrp/for.cs @@ -0,0 +1,10 @@ +class FOR +{ + public FOR() + { + for (let i = 0; i < 10; i++) + { + Console.WriteLine(log(i)); + } + } +} \ No newline at end of file diff --git a/CSahrp/forEach.cs b/CSahrp/forEach.cs new file mode 100644 index 0000000..c85daf0 --- /dev/null +++ b/CSahrp/forEach.cs @@ -0,0 +1,9 @@ +class FOREACH +{ + public FOREACH() + { + const int a = { 7, 10, 1, 5, 2 }; + foreach (int i in b) + Console.WriteLine(i); + } +} \ No newline at end of file diff --git a/CSahrp/goto.cs b/CSahrp/goto.cs new file mode 100644 index 0000000..ad96322 --- /dev/null +++ b/CSahrp/goto.cs @@ -0,0 +1,26 @@ +class GOTO +{ + public GOTO() + { + Console.WriteLine("Coffee sizes: 1=Small 2=Medium 3=Large"); + Console.Write("Please enter your selection: "); + string s = Console.ReadLine(); + int n = int.Parse(s); + int cost = 0; + switch (n) + { + case 1: + cost += 25; + break; + case 2: + cost += 25; + goto case 1; + case 3: + cost += 50; + goto case 1; + default: + Console.WriteLine("Invalid selection."); + break; + } + } +} \ No newline at end of file diff --git a/CSahrp/while.cs b/CSahrp/while.cs new file mode 100644 index 0000000..81e408b --- /dev/null +++ b/CSahrp/while.cs @@ -0,0 +1,11 @@ +class WHILE +{ + public WHILE() + { + int a = 0; + while (a < 10) + { + Console.WriteLine(a++); + } + } +} \ No newline at end of file