-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
56 lines (51 loc) · 1000 Bytes
/
main.cpp
File metadata and controls
56 lines (51 loc) · 1000 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
51
52
53
54
55
56
#include <iostream>
#include "point.h"
#include "complex.h"
using namespace std;
int main()
{
point d;
point k;
point p;
complex f;
point e;
double c;
point p1(3,5);
cout << "P1: " <<endl;
p1.show();
point p2(10,13);
cout << "P2: " <<endl;
p2.show();
point *g;
g = new point (5.0,6.0);
cout<<g<<endl<<endl;
cout << "Type Casting: " <<endl<<endl;
f = (complex) p ;
f.show();
e=p2;
if (p1>p2)
{
cout << "Greater Operator: " <<endl;
cout << "P1 is Greater Than P2" <<endl;
}
else
{
cout <<endl << "Greater Operator: " <<endl <<endl;
cout << "P2 is Greater Than P1" <<endl <<endl;
}
cout << "Assignment Operator: " <<endl<<endl;
e.show();
cout << "Constructor overload: " <<endl<<endl;
p1 = (point) 23;
p1.show();
cout << "Add Operator: " <<endl<<endl;
d = p1+p2;
//d=sum(p1,p2);
c = p1*p2;
d.show();
cout << "Multiply Operator: " <<endl;
cout<<c<<endl;
//k=p1+10.4;
//k.show();
system ("pause");
}