From 6144e314461063f32b08ecf479da30787f945a2a Mon Sep 17 00:00:00 2001 From: AlsaMunir <115931519+AlsaMunir@users.noreply.github.com> Date: Wed, 19 Oct 2022 20:04:40 +0500 Subject: [PATCH] This program has been modified --- tut31.cpp | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/tut31.cpp b/tut31.cpp index bc521c6..f40b771 100644 --- a/tut31.cpp +++ b/tut31.cpp @@ -8,29 +8,30 @@ class Complex int a, b; public: - Complex(){ + Complex(); + Complex(int x, int y); + Complex(int x); + void printNumber(); +}; + Complex::Complex() + { a = 0; b =0; - } - - Complex(int x, int y) - { + } +Complex::Complex(int x, int y) +{ a = x; b = y; - } - - Complex(int x){ +} +Complex::Complex(int x) +{ a = x; b = 0; - } - - - - void printNumber() - { +} +void Complex::printNumber() +{ cout << "Your number is " << a << " + " << b << "i" << endl; - } -}; +} int main() { Complex c1(4, 6);