-
Notifications
You must be signed in to change notification settings - Fork 0
/
one.cpp
70 lines (59 loc) · 854 Bytes
/
one.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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
/*#include<iostream>
using namespace std;
class reverse
{ int n;
public:
void input();
void output();
};
void reverse :: input()
{
cout<<"Enter the number"<<endl;
cin>>n;
}
void reverse :: output ()
{ int a,r=0,i=100;
while(n>0)
{ a=n%10;
r=r+(a*i);
i=i/10;
n=n/10;
}
cout<<"The reverse number : "<<r;
}
int main()
{ reverse x;
x.input();
x.output();
return 0;
}*/
/* Operator Overloading
#include<iostream>
using namespace std;
class Complex
{ private:
int x,y;
public:
Complex()
{ }
Complex(int a, int b)
{ x=a;y=b;
}
Complex add(Complex b)
{ Complex temp;
temp.x= x+b.x;
temp.y=y+b.y;
return temp;
}
void output()
{ cout<<"The value of a is is : "<<x<<" b is "<<y;
}
};
int main()
{ Complex c1(4,8);
Complex c2(5,10);
Complex c3;
c3=c1.add(c2);
c2.output();
return 0;
}*/