Already have an account? Get multiple benefits of using own account!
Login in your account..!
Remember me
Don't have an account? Create your account in less than a minutes,
Forgot password? how can I recover my password now!
Enter right registered email to receive password!
Create Complex number using constructor:
class complex
{
private:
int real,ima;
static int count;
public :
complex (int a,int b) //constructor
real=a;
ima=b;
}
complex() //default constructor
real=0;
ima=0;
void show()
cout<< real<<"\n"< } friend complex sum(complex ,complex); ~complex () // destructor { } }; int complex :: count=15; complex sum( complex a,complex b) { complex c3; c3.real= a.real + b.real; c3.ima= a.ima + b.ima; return c3; } void main() { complex a,b,c; clrscr(); a = complex(10,12); //constructor b= complex(12,10); c=sum(a,b); c.show(); //cout < getch(); }
friend complex sum(complex ,complex);
~complex () // destructor
};
int complex :: count=15;
complex sum( complex a,complex b)
complex c3;
c3.real= a.real + b.real;
c3.ima= a.ima + b.ima;
return c3;
void main()
complex a,b,c;
clrscr();
a = complex(10,12); //constructor
b= complex(12,10);
c=sum(a,b);
c.show();
//cout < getch(); }
getch();
E x p r e s sion and their types: An expression will be in form of mathematical expression with C++ syntax embedded with it. Expressions are of following types which m
Ba s i c r u l e s o f C + + p r o g r a m : · I t m u s t h a v e o n l y o n e m a i n f u n c ti o n ·
Hi is there any chance to get assignment for fresher tutor
There are 3 acceptable answers: "Never," "Rarely "and" When the problem domain cannot be accurately modelled any other way."
A: Use a member while you can and a friend when you need to. Sometimes friends are better syntactically (e.g., in class Fred, friend functions let the Fred parameter to be secon
Explain about the Integer constants in c language? An integer constant is the integer valued number and it refers to a sequence of digits. A decimal integer constant includes o
C program to print L diagonal triangle: void main() { int i=0,j=0; int arr[rows][cols]; for (i=0; i
Develop a C++ program that uses a while to determine the gross pay (in Dollars) for each of several employees. The company pays “straight-time” for the first 40 hours worked by ea
Define How Passing Arrays to a Function? A complete array can be passed to a function as an argument. The manner in which the array is passed be different from that of an ordin
program to write superposition of waves using class and objects
Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!
whatsapp: +91-977-207-8620
Phone: +91-977-207-8620
Email: [email protected]
All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd