-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
80 lines (59 loc) · 2.18 KB
/
Program.cs
File metadata and controls
80 lines (59 loc) · 2.18 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
using System;
namespace ConsoleApp1
{
class Program
{
static void Main(string[] args)
{
Console.SetCursorPosition(40, 0);
{
Console.WriteLine("you can find me wuth this email armynparsa789@gmail.com");
Console.WriteLine("you can do these things in this calculater (+ , - , / , *) but this code is updating");
}
Console.ForegroundColor = ConsoleColor.red;
Console.WriteLine("write first number + second number and for third number read information under this sentense");
int p = 0;
int o = 10;
Console.WriteLine("NUMBER 1 FOR +");
Console.WriteLine("NUMBER 2 FOR -");
Console.WriteLine("NUMBER 3 FOR *");
Console.WriteLine("NUMBER 4 FOR /");
label1:
try
{
while (p < o)
{
int f = int.Parse(Console.ReadLine());
int w = int.Parse(Console.ReadLine()); ;
int x = int.Parse(Console.ReadLine());
if (x == 1)
{
Console.WriteLine(f + w);
}
if (x == 2)
{
Console.WriteLine(f - w);
}
if (x == 3)
{
Console.WriteLine(f * w);
}
if (x == 4)
{
Console.WriteLine(f / w);
}
p += 1;
Console.ReadKey();
Console.Clear();
}
}
catch (Exception)
{
Console.WriteLine("you should wright number.");
goto label1;
Console.ReadKey();
throw;
}
}
}
}