-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram6_208.cpp
More file actions
50 lines (38 loc) · 835 Bytes
/
Program6_208.cpp
File metadata and controls
50 lines (38 loc) · 835 Bytes
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
//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 nobj(iValue1,iValue2);
iRet = nobj.Maximum();
cout<<"Maximum number is : "<<iRet<<"\n";
return 0;
}