Data members
Real part
Imaginary part
Member Functions
getComplexValues(int real,int imaginary)
PrintComplexumber()
Programs
#include<iostream.h>
#inclue<conio.h>
class complex
{
private:
int real;
int imaginary;
public:
void getComplexValues(int r,int i)
{
real=r;
imaginary=i;
}
void printComplexNumber()
{
cout<<"The given Complex Number is"<<real<<"+i"<<imaginary<<"\n";
}
};
void main()
{
Complex C;
clrscr();
C.getComplexValues(3,5);
C.printComplexNumber();
getch();
}
Output:
The Given Complex Number is 3+i5
Real part
Imaginary part
Member Functions
getComplexValues(int real,int imaginary)
PrintComplexumber()
Programs
#include<iostream.h>
#inclue<conio.h>
class complex
{
private:
int real;
int imaginary;
public:
void getComplexValues(int r,int i)
{
real=r;
imaginary=i;
}
void printComplexNumber()
{
cout<<"The given Complex Number is"<<real<<"+i"<<imaginary<<"\n";
}
};
void main()
{
Complex C;
clrscr();
C.getComplexValues(3,5);
C.printComplexNumber();
getch();
}
Output:
The Given Complex Number is 3+i5
Thanks 🙏
ReplyDeleteThank you so much for sharing.
ReplyDeleteHave a look on custom software development company,if you want any software solutions.we bring to you the BEST solutions at nominal rates.