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();
This program requires the use of a windows box, no console applications are allowed. Prepare for Christmas now. Each year, Reindeer Gift Emporium publishes a Christmas price list
In general, Roman numerals can be converted mathematically by simply assigning a numerical value to each letter, according to the chart below, and calculating a total: M=1000 | D=5
Explain the Macros? Preprocessor' is a translation stage that is applied to your source code before the compiler proper gets its hands on it. Usually the preprocessor performs
write a program that declares and initializes 2 integer variable a and b with the value 35 and 14, and displays and calculates their sum,product,quotient and real division result.t
C Program for SELECT THE CHAR WHICH U WANT #include stdio.h> #include conio.h> void main() { void substr(char[], int *, int *); int a,b
Identify 2 to 3 existing algorithms commonly used for object tracking. Algorithms should be in C or written in MATLAB language. Document these algorithms in flowcharts and run thes
program code
The goto statement This statement can be used to branch to another statement of the program. This is rarely used as it violates the principle of structured programming. Though
Write a C program to calculate the output Y for a given value of X for the following formula Y=X 2 + 2X +3 #include stdio.h void main() { char promt; float y,x
Problem 1. Explain Break and continue statements in C++. Explanation of Break statement Explanation of Continue statement 2. Explain concepts of constructors and
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