-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
71 lines (45 loc) · 1.74 KB
/
main.cpp
File metadata and controls
71 lines (45 loc) · 1.74 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
63
64
65
66
67
68
69
70
71
#include <iostream>
#include "complexType.h"
using namespace std;
int main() {
complexType comp1(17, 32);
complexType comp2;
complexType comp3;
cout << "Enter Complex Number in th form (a,b) : ";
cin >> comp2;
cout << endl << "Value of Comp1 : " << comp1;
cout << endl << "Value of Comp2 : " << comp2;
cout << endl << "Incremented Value of Comp1 : " << ++comp1;
cout << endl << "Decremented Value of Comp2 : " << --comp2;
comp3 = comp1 + comp2;
cout << endl << "Value of Comp3 : " << comp3;
cout << endl << comp1 << " * " << comp2 << " = " << comp1 * comp2;
cout << endl << comp3 << " - " << comp2 << " = " << comp3 - comp2;
cout << endl << comp1 << " / " << comp2 << " = " << comp1 / comp2;
complexType comp4(comp2);
cout << endl << "Value of Comp4 : " << comp4 << endl;
comp4.setRealNumber(50);
cout << endl << "New Value of Comp4 : " << comp4;
complexType comp5;
comp5 = comp1;
cout << endl << "Value of Comp5 : " << comp5;
comp5.setImaginaryNumber(97);
cout << endl << "New Value of Comp5 : " << comp5 << endl;
if (comp5 == comp1)
cout << endl << "THEY GOT THE SAME REAL AND IMAGINARY NUMBER";
else
cout << endl << "THEY GOT DIFFERENT REAL AND IMAGINARY NUMBER";
if (comp2 != comp1)
cout << endl << "COMP2 IS NOT THE SAME AS COMP1";
else
cout << endl << "COMP2 IS THE SAME AS COMP1";
if (comp2 < comp1)
cout << endl << "COMP2 IS LESS THAN COMP1";
else
cout << endl << "COMP2 IS NOT LESS THAN COMP1";
if (comp4 >= comp3)
cout << endl << "COMP4 IS GREATER THAN OR EQUAL TO COMP3";
else
cout << endl << "COMP4 IS NOT GREATER THAN OR EQUAL TO COMP3";
return 0;
}