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();
Difference between Echo and print statement. print()and echo() are language constructs in PHP, both are used to output strings. Both statements are of almost same Speed. ech
padovan string c++ program
Dynamic Initialization of objects: It is initializing the objects by passing the valued to the constructor from the user input or other means. Through cin operator a value
write a c program to compute a padovan string
Suppose we use Lists to represent a movie which has a title, cast and year. For example, the following list represents the movie, "Die Hardly", with the cast "Bruce Willing" and "T
Mixed Mode Expressions and Implicit type Conversions A mixed mode expression is one in which the operands are not of the similar type. In this case, the operands are converted
A company needs 200 pencils per year . you cannot simply use this price as the cost of pencils two years from now. Because of inflation the cost is likely to be higher than it is
in this problem you are given a board in which some of the elements are placed..each element represent ancolor.fill the other elements in the board such that none of the adjacent e
Ask question #Minimum 300 words accepted#
What about Virtual Destructor?
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