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]
2 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]2 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
I forgot to tell it’s on Roblox for those who play and wanted to be friends and new ppl username is mosarider489
never [62]

Answer:.

Explanation:

.

8 0
3 years ago
Read 2 more answers
I need someone to transfer this into a database in excel Please help :D 7 pts
sergejj [24]
What kind of database?
6 0
2 years ago
My laptop volume has got really low all of a sudden. It wasn't the best to start with but now i can barely even hear it at 100%.
nadezda [96]

Answer:

make sure the speaker is clean and you volume setting is on normal there is alot of setting for deaf people so make sure that is correctly

4 0
2 years ago
Forms open in _______, which provides a user-friendly interface for entering data.
sergey [27]
They open in pdf format

5 0
3 years ago
To make the most informed purchasing decision, you should:
musickatia [10]

Answer:

its either A or B but im leaning more towards B

Explanation:

6 0
2 years ago
Other questions:
  • Which practice represents the trait of effective communication?
    6·2 answers
  • Which skill refers to the ability to visualize and implement possible business solutions to problems?
    6·1 answer
  • Jeremy is typing a term paper on his computer and saves it every five minutes or so for good measure. which of the following bes
    11·1 answer
  • Technologies have advanced to allow computer chips to be placed in almost anything and to be connected to a network almost anywh
    8·1 answer
  • 1. ___________ ensures the integrity and security of data that are passing over a network.
    13·1 answer
  • If you wanted to look up an article from the Chicago Tribune the best place to start would be
    7·1 answer
  • __________ are hosted on dedicated computers known as 'web servers'.​
    8·2 answers
  • True or false a computer with a high efficiency rating should stay cooler than one with a low effiency rating
    9·1 answer
  • Cuáles eran las condiciones de vida de las mujeres durante el renacimiento perduran​
    14·1 answer
  • Tina has taken the time to modify font sizes and colors in a text box and would like to duplicate those settings on other text b
    12·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!