1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
postnew [5]
3 years ago
12

Write a function namedmake_complex that stores its twoarguments (both of type double) in acomplex structure, then returns thestr

ucture.
Computers and Technology
1 answer:
valentina_108 [34]3 years ago
3 0

Answer:

#include <iostream>

using namespace std;

struct complex{//structure of comlex number..

double real;

double img;

};

complex make_complex(double a,double b)//function to return complex number with two arguments of type double..

{

   complex n1;

   n1.real=a;

   n1.img=b;

   return n1;//returning complex number..

}

int main() {

   complex n;

   double a,b;

   cout<<"Enter real and Imaginary respectively"<<endl;

   cin>>a>>b;//taking input of real and imaginary parts..

   n=make_complex(a,b);//calling function..

   cout<<"Comlex number is : "<<n.real<<" + i"<<n.img;//printing the output..

return 0;

}

output:-

Enter real and Imaginary respectively

5.4 8.9

Comlex number is : 5.4 + i8.9

Explanation:

First I have created a structure for complex number.Then created a function to make complex number according to the question which returns a complex number.

You might be interested in
Which word most strongly appeals to pathos?
const2013 [10]

Answer:

I think it would be unfulfilled

6 0
3 years ago
Netflix suggestions ?
hjlf

Answer:Lost in space

Explanation:It is a great space movie do not watch if your scared

3 0
3 years ago
Read 2 more answers
What is the name of the first practical asymmetric cryptosystem that was created?
victus00 [196]

Answer:

I think the name is RSA

4 0
3 years ago
When inserting a fly in animation what is the first step in the process?
weqwewe [10]

Answer:

you select the element you wish to animate

6 0
3 years ago
Two types of business communications enhanced by desktop publishing are
Likurg_2 [28]
The correct option is D.
The two types of business communication that are enhanced by desktop publishing are internal and external communication. Internal communication refers to the information and ideas that are exchange within the organisation while external communication refers to information and ideas that are exchange between the organisation and the outside world.<span />
4 0
3 years ago
Read 2 more answers
Other questions:
  • An outline is most like which of the following?
    7·1 answer
  • Name that red flag asigment
    15·2 answers
  • What is another name for a central processing unit? Computer Integrated circuit Microprocessor Transistor
    9·2 answers
  • What is the nickname given to the new generation that was raised entirely within the digital age and often communicates through
    7·2 answers
  • Write a for loop to print all NUM_VALS elements of array hourlyTemp. Separate elements with a comma and space. Ex: If hourlyTemp
    11·1 answer
  • In confirmatory visualization Group of answer choices Users expect to see a certain pattern in the data Users confirm the qualit
    9·1 answer
  • Mississippi law codes state that bullying and cyberbullying are against the law. A court can decide to incur ___________________
    10·1 answer
  • Unconformities develop when new sedimentary layers accumulate atop old, eroded layers, resulting in a geologic hiatus. Which of
    9·1 answer
  • Jonas is creating a presentation for students about volunteering. He wants to begin by speaking about the various opportunities
    11·1 answer
  • How to tell if your phone is being monitored
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!