Program to multiply 2 complex no.s - c++ program, C/C++ Programming

 THIS PROGRAM IS TO MULTIPLY THE TWO COMPLEX NO.S GIVEN BY THE USER

#include
#include
#include
struct complex
    {
    int real;
    int imag;
    };

void main()
 {
 clrscr();
 complex a,b,c;
 cout<<"input the real part for first complex number : ";
 cin>>a.real;
 cout<<"input the imaginary part for first complex number : ";
 cin>>a.imag;
 cout< cout<<"input the real part for second complex number : ";
 cin>>b.real;
 cout<<"input the imaginary part for second complex number : ";
 cin>>b.imag;
 c.real = (a.real*b.real-a.imag*b.imag)+(a.real*b.imag+a.imag*b.real);
// c.imag = a.imag * b.imag;
 cout< cout<<"the multiplication is : "< getch();
 }

Posted Date: 10/22/2012 5:07:47 AM | Location : United States







Related Discussions:- Program to multiply 2 complex no.s - c++ program, Assignment Help, Ask Question on Program to multiply 2 complex no.s - c++ program, Get Answer, Expert's Help, Program to multiply 2 complex no.s - c++ program Discussions

Write discussion on Program to multiply 2 complex no.s - c++ program
Your posts are moderated
Related Questions
What happens if you write following code? string& foo()

A small shop sells 280 different items. Every item is identified by a 3 - digit code. All items which start with a zero (0) are cards, all items which start with a one (1) are swee

Operation on String - C ++ Program: Write a program to define operations on string in c++. class String {    char *char_ptr;   // pointer to string contents    int le

Explain the Function Prototype? The Functions must be declared before they are used, ANSI C provides for the new function declaration syntax called as the function prototype,

A Padovan string P(n) for a natural number n is defined as: P(0) = ‘X’ P(1) = ‘Y’ P(2) = ‘Z’ P(n) = P(n-2) + P(n-3), n>2 where + denotes string concatenation. For a string of t

Implement (a part of) electronic election Scenario where following political parties are participating in election: PPP, PML and PTI.  Create a class PollingStation where it stor

Aim: Write a program of multipication using inline function class Multiply {           int x,y;           public:           void getdata();           inline calc

Can you help me with a C++ project?


A palindrome is a string that reads the same from both the ends. Given a string S convert it to a palindrome by doing character replacement. Your task is to convert S to palindrome