-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
119 lines (83 loc) · 3.05 KB
/
Program.cs
File metadata and controls
119 lines (83 loc) · 3.05 KB
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
using System;
using System.Collections.Generic;
class Program
{
static void Main()
{
//Console.Write("Enter name: ");
//String a = Console.ReadLine();
//Console.WriteLine("entered name is: " + a);
//Console.WriteLine($"entered name is {a}");
////print movie ticket price based on user entered age; if less than 12=null, 12-18 = 100rs, 18+ = 200rs
//Console.Write("Enter age: ");
//int age = Convert.ToInt32(Console.ReadLine());
//if (age < 12)
//{
// Console.WriteLine("Free");
//}
//else if (age >= 12 && age < 18)
//{
// Console.WriteLine("100rs");
//}
//else {
// Console.WriteLine("200rs");
//}
////for loop to print 1 to 10 (case1: 5=continue; case2: 5=break)
//for (int i = 0; i <= 10; i++)
//{
// if (i == 5)
// {
// break;
// }
// Console.Write(i);
//}
////use while and switch case to do mathematical operation based on user input
//while (true) {
// Console.Write("Enter num 1: ");
// double n1=Convert.ToDouble(Console.ReadLine());
// Console.Write("Enter num 2: ");
// double n2 = Convert.ToDouble(Console.ReadLine());
// Console.WriteLine(" Choose operation: + - * / %");
// String o=Console.ReadLine();
// switch (o) {
// case "+": Console.WriteLine(n1+ n2); break;
// case "-": Console.WriteLine(n1 - n2); break;
// case "*": Console.WriteLine(n1 * n2); break;
// case "/": Console.WriteLine(n1 / n2); break;
// case "%": Console.WriteLine(n1 % n2); break;
// }
// break;
//}
////do while: keep asking number from user till >0 number is not entered
//int num = 0;
//do
//{
// num=Convert.ToInt32 (Console.ReadLine());
//} while (num <= 0);
//Console.WriteLine(num);
////foreach loop:
//String[] fruits = { "Apple", "Banana", "Mango" };
//foreach (String fruit in fruits)
//{
// Console.WriteLine(fruits[0] + " " + fruit[0]+" " + fruit);
//}
////goto start
//int count = 0;
//start:
// count++;
// Console.WriteLine("count: "+count);
// if (count < 5)
// {
// goto start;
// }
////create a todo list task for yourself, show 5 tasks to be done today. after this print as any one task is done, now show remaining todo tasks
//List<String> name = new List<string>();
//name.Add("Sleep");
//name.Add("Wake");
//name.Add("Study");
//name.Add("Eat");
//foreach (string s in name) {
// Console.WriteLine(s);
//}
}
}