-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmax_min.cs
50 lines (41 loc) · 1.02 KB
/
max_min.cs
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
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApplication
{
class maxmin
{
public int max;
public int min;
public maxmin(out int a)
{
a = 0;
max = -1000000000;
min = 1000000000;
for (int i = 0; i < 10; i++)
{
Console.WriteLine("Enter number");
int num = int.Parse(Console.ReadLine());
if(num > max )
{
max = num;
}
if(min > num)
{
min = num;
}
}
Console.WriteLine("Max : " + max + " min : " + min);
}
}
class Program
{
static void Main(string[] args)
{
int num;
maxmin obj = new maxmin(out num);
}
}
}