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
Instead of starting with a blank PowerPoint presentation, you can use a __________.
Nuetrik [128]
You can use a Template. :)
8 0
3 years ago
Read 2 more answers
Identify 3 distractions for young drivers and explain how you plan to minimize these distractions.
Rom4ik [11]
1 distraction is phones , texting and driving . They could have a system in their car which activated by a voice assistant who could do it al for them
4 0
3 years ago
When you store files "in the cloud", you are __________.<br><br> I kinda need the answer now
Angelina_Jolie [31]
Putting them online? what are the answers to choose from?
7 0
3 years ago
I just need a confirmation. Is the best time to create a Vista photograph at Twilight?
SVEN [57.7K]
Yes because you won't have too much light and you won't have too little
3 0
4 years ago
The intersection of a row and a column is commonly called what?
Ierofanga [76]
I dont know the answer sorry i just need the points
6 0
3 years ago
Other questions:
  • "giga" can mean both 109 and 230. explain to what each refers. can this cause confusion when reading a computer advertisement?
    15·1 answer
  • Windows uses a memory-management technique known as ________ to monitor which applications you use most frequently and then prel
    8·1 answer
  • Electronic transmission of information standards, such as transaction and code sets and uniform identifiers, are covered underQu
    8·1 answer
  • 2. Create a file with the follow integer/string content and save it as fun.txt. 6 fun. 3 hello 10 &lt;&gt; 2 25 4 wow! Write an
    14·1 answer
  • Technical colleges offer certification in audio engineering through programs that are normally from 2 to 6 months long.
    6·1 answer
  • Fill in the blanks of the SQL Statements: Fund_Id VARCHAR(10) , Donor_id VARCHAR(10) , Count_Of_Receipts INTEGER, Total_Receipts
    15·1 answer
  • Need help asap<br> give the correct answer!!
    15·2 answers
  • How is a WAN different from a LAN?
    10·1 answer
  • Why do meteorologists use data such as temperature, wind speed, and air
    9·1 answer
  • What does it mean to clear a setting in a dialog box?
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!