create a class complex having real and imaginary part of a
complex no. as a data member. overload the binary
operators(+,- and *) to perform the operations on complex
no. objects. overload binary operator using friend function.

Answer Posted / fgf

i also want answer for this question

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is class and example?

567


What is destructor example?

593


Can destructor be overloaded?

595


#include #include #include #include void insert(struct btreenode **, int); void inorder(struct btreenode *); struct btreenode { struct btreenode *leftchild; struct btreenode *rightchild; int data; }; main() { struct btreenode *bt; bt=(struct btreenode *)NULL; int req,i=1,num; clrscr(); printf("Enter number of nodes"); scanf("%d",&req); while(i<=req) { printf("Enter element"); scanf("%d",&num); insert(&bt,num); i++; } inorder(bt); } void insert(struct btreenode **sr, int num) { if(*sr==NULL) { *sr=(struct btreenode *)malloc (sizeof(struct btreenode)); (*sr)->leftchild=(struct btreenode *)NULL; (*sr)->rightchild=(struct btreenode *)NULL; (*sr)->data=num; return; } else { if(num < (*sr)->data) insert(&(*sr)->leftchild,num); else insert(&(*sr)->rightchild,num); } return; } void inorder(struct btreenode *sr) { if(sr!=(struct btreenode *)NULL) { inorder(sr->leftchild); printf("\n %d",sr->data); inorder(sr->rightchild); } else return; } please Modify the given program and add two methods for post order and pre order traversals.

3246


What is new keyword in oops?

589






How to hide the base class functionality in Inheritance?

636


What is object in oop with example?

697


What are the 3 principles of oop?

616


What is a superclass in oop?

665


assume the program must insert 4 elements from the key board and then do the following programs.sequential search(search one of the elements),using insertion sort(sort the element) and using selection sort(sort the element).

1662


officer say me - i am offered to a smoking , then what can you say

1578


What are the benefits of polymorphism?

620


Is react oop?

607


What is ambiguity in inheritance?

625


What is destructor in oop?

621