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();
what is the purpose of pointer ? what is the syntax? how it works?
A game is played with three piles of stones and two players. At her turn, a player removes one or more stones from the piles. However, if she takes stones from more than one pile,
Project Description: I want a simple program that will spoof my hardware id. I should be able to prepare the id to spoof to in the program and press "random" button to spoof to
Why should I employ new instead of truthful old malloc()? A: Constructors/destructors, type safety, overridability. Constructors/destructors: unlike malloc(sizeof(Fred)), new
In this sub-task will you implement three functions for the final three function prototypes that will do exactly the same as the three functions that you have just written. This ti
Write a program to input two integers. If they are equal display "The numbers are equal". Otherwise display a message if the first is a multiple of the second or if it is not a mul
how to avoid duplicates strings in an array
The purpose of this assignment is to familiarize you with the notion of encapsulation as well as some aspects of IP and ICMP. Write your programs in C or C++. They will be grade
write a c++ program to accept 3 numbers and find the largest of 3 numbers
Byteland county is very famous for luminous jewels. Luminous jewels are used in making beautiful necklaces. A necklace consists of various luminous jewels of particular colour. Nec
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