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();
code for K-means to form clusters
Program of cascading: class vector{ private : int v[3]; public: friend istream & operator >> (
The task consists of two parts which are both preferably implemented in one source file. Towards the end of this document you will find a code skeleton that you must assume. Start
Should I call a destructor explicitly on a local variable?
Objective of this Program: (a) To learn more about modularization of a program into independent modules, (b) To use arrays in a program, (c) To get some experience with us
#include #include #include #include #include class Employee { private: char *Name; //Set them as pointers... int IdNumber; char *Department; char *Position; public: voi
C Program to Check EVEN & ODD NO main() { int n, a; clrscr(); printf("ENTER ANY NUMBER: "); scanf("%d", &n);
Write a program to illustrate array of structures? struct customer { int id; char name[15]; }; struct customer c[100]; . In the above instance, the array of Structures is
Structures A structure is a derived data type. It is a combination of logically related data items. Unlike arrays, which are a collection of such as data types, structures can
: Write a program that prompts the user to enter five digit positive numbers. The program then outputs the digits of the number one digit per line. Eg if the user enters 32456, th
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