#include<iostream.h> #include<conio.h> class complex { int a,b; public: void read() { cout<<"\n\nEnter the REAL PART : "; cin>>a; cout<<"\n\nEnter the IMAGINARY PART : "; cin>>b; } complex operator +(complex c2) { complex c3; c3.a=a+c2.a; c3.b=b+c2.b; return c3; } complex operator -(complex c2) { complex c3; c3.a=a-c2.a; c3.b=b-c2.b; return c3; } complex operator *(complex c2) { complex c3; c3.a=(a*c2.a)-(b*c2.b); c3.b=(b*c2.a)+(a*c2.b); return c3; } complex operator /(complex c2) { complex c3; c3.a=((a*c2.a)+(b*c2.b))/((c2.a*c2.a)+(c2.b*c2.b)); c3.b=((b*c2.a)-(a*c2.b))/((c2.a*c2.a)+(c2.b*c2.b)); return c3; } void display() { cout<<a<<"+"<<b<<"i"; } }; void main() { complex c1,c2,c3; int choice,cont; do { clrscr(); cout<<"\t\tCOMPLEX NUMBERS\n\n1.ADDITION\n\n2.SUBTRACTION\n\n3.MULTIPLICATION\n\n4.DIVISION"; cout<<"\n\nEnter your choice : "; cin>>choice; if(choice==1choice==2choice==3choice==4) { cout<<"\n\nEnter the First Complex Number"; c1.read(); cout<<"\n\nEnter the Second Complex Number"; c2.read(); } switch(choice) { case 1 : c3=c1+c2; cout<<"\n\nSUM = "; c3.display(); break; case 2 : c3=c1-c2; cout<<"\n\nResult = "; c3.display(); break; case 3 : c3=c1*c2; cout<<"\n\nPRODUCT = "; c3.display(); break; case 4 : c3=c1/c2; cout<<"\n\nQOUTIENT = "; c3.display(); break; default : cout<<"\n\nUndefined Choice"; } cout<<"\n\nDo You Want to Continue?(1-Y,0-N)"; cin>>cont; }while(cont==1); getch(); }
program to find maximum of two numbers using pointers
VBnet program to find the prime numbers between 100 to 200?
for(int i = 1; i < 100; i+=2) { System.out.println(i); }
This would require some computer knowledge. It can make it easier to find out the prime numbers without figuring it out in your head.
Yes, do write. That's what you always have to do when you have got a homework-program.
write an assembly language program to find sum of N numbers
program to find maximum of two numbers using pointers
VBnet program to find the prime numbers between 100 to 200?
k
i need this answer
Please visit http://talentsealed.blogspot.com/2009/10/to-find-sqaure-of-numbers-using-c.htmlfor the answer.
Since there is an infinite set of prime numbers the answer would be infinity.
for(int i = 1; i < 100; i+=2) { System.out.println(i); }
There is no such thing; you seem to have misunderstood something.Any real number can be regarded as a complex number with zero imaginary part, eg.: 5 = 5+0i
write a vb program to find the magic square
please somebody should help me answer this question..I have a project on it even! It seems almost impossible at the moment.
This would require some computer knowledge. It can make it easier to find out the prime numbers without figuring it out in your head.