-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram7_209.cpp
More file actions
62 lines (45 loc) · 1.06 KB
/
Program7_209.cpp
File metadata and controls
62 lines (45 loc) · 1.06 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
//Write a c++ program to accept the numbers and find the max
#include<iostream>
using namespace std;
class Number
{
public:
int iNo1;
int iNo2;
Number(int X, int Y)
{
iNo1 = X;
iNo2 = Y;
}
int Maximum()
{
if(iNo1 > iNo2)
{
return iNo1;
}
else
{
return iNo2;
}
}
};
int main()
{
int iRet = 0;
int iValue1 = 0, iValue2 = 0;
cout<<"Enter first number : "<<"\n";
cin>>iValue1;
cout<<"Enter second number : "<<"\n";
cin>>iValue2;
Number nobj1(iValue1,iValue2);
iRet = nobj1.Maximum();
cout<<"Maximum number is : "<<iRet<<"\n";
cout<<"Enter first number : "<<"\n";
cin>>iValue1;
cout<<"Enter second number : "<<"\n";
cin>>iValue2;
Number nobj2(iValue1,iValue2);
iRet = nobj2.Maximum();
cout<<"Maximum number is : "<<iRet<<"\n";
return 0;
}