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();
Spider webs have two types of silk, sticky silk and strength silk, spiders do not move on the sticky silken threads only on the strength threads. Assume one type of spider creates
what happens when the following command is used? chmod u=rwx,go=r-x foo
Introduction: This assignment requires a knowledge of variables (integers, char types), loops, conditionals, switch, functions, char arrays, string arrays, number arrays, struc
Multilevel Inheritance In multilevel inheritance there is a parent class , from whom we derive another class . now from this derived class we can derive another class and so on
Does improper inheritance have a potential to wreck a project? Many projects meet a dead end due to bad inheritance. Hence it certainly has potential to wreck a project. Sma
Define External Storage Class - computer programming? When a variable is declared outside a function the storage is permanently assigned to it and its storage class is 'extern'
Write a program to find the area under the curve y = f(x) between x = a and x = b, integrate y = f(x) between the limits of a and b. The area under a curve between two points can b
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
A: It let you to provide an intuitive interface to users of your class, as well as makes it possible for templates to equally work well with classes and built-in/intrinsic types.
Pointer to function: int mul(int a, int b, int c) { return a*b*c; } void main() { int (*function_pointer)(int, int, int); function_pointer = &mul;
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