-
Notifications
You must be signed in to change notification settings - Fork 0
/
Numbers.cs
33 lines (32 loc) · 1.03 KB
/
Numbers.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
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace LatihanOverloadingMethod
{
public class Numbers
{
private int _a, _b;
public int FindMinimum(int number1, int number2)
{
return number1 < number2 ? number1 : number2;
}
public int FindMinimum(int number1, int number2, float number3)
{
_a = number1 < number3 ? number1 : (int)number3;
_b = number2 < number3 ? number2 : (int)number3;
return number1 < number2 ? _a : _b;
}
public int FindMaximum(int number1, int number2)
{
return number1 > number2 ? number1 : number2;
}
public int FindMaximum(int number1, int number2, float number3)
{
_a=number1 > number3? number1 : (int)number3;
_b=number2 > number3? number2 : (int)number3;
return number1 > number2 ? _a : _b;
}
}
}