-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMinimum.cpp
42 lines (37 loc) · 905 Bytes
/
Minimum.cpp
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
#include <iostream>
using namespace std;
class Minimum {
private:
int num1;
int num2;
int num3;
public:
void getInputs() {
cout << "Enter Number 1: ";
cin >> num1;
cout << "Enter Number 2: ";
cin >> num2;
cout << "Enter Number 3: ";
cin >> num3;
}
void findMinimum() {
if (num1 < num2) {
if (num1 < num3) {
cout << "Smallest Number 1: " << num1;
} else {
cout << "Smallest Number 3: " << num3;
}
} else {
if (num2 < num3) {
cout << "Smallest Number 2: " << num2;
} else {
cout << "Smallest Number 3: " << num3;
}
}
}
};
int main() {
Minimum minimum;
minimum.getInputs();
minimum.findMinimum();
}