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
The hardware components of a computer system interact with each other by using which of the following?
Inga [223]
B it is b..............................................
6 0
4 years ago
Read 2 more answers
Match these step-by-step directions in the order that you will find them in this course.
7nadin3 [17]

Answer:

1.Go to the View tab and select Watch.

2.Comparison

3.Editing

4.Drawing (I think)

5.Predesigned slides available for creating a new presentation

Explanation:

6 0
3 years ago
3-5 paragraphs on how and why robotics are used in nuclear fields
Dmitriy789 [7]
Robots can be used in fabrics where they now use them to help do the work faster and do somethings that humans cant do.
3 0
4 years ago
Read 2 more answers
"Your friend is having a birthday and you want to create a slide-show presentation with pictures of her that you have saved on y
OleMash [197]
Could you be more specific? So I can help you in the best way I can.
5 0
3 years ago
Fwee Pwoints Fwor You! :3
Fittoniya [83]

Answer:

Hey thanks for them........

8 0
3 years ago
Read 2 more answers
Other questions:
  • If you use the ___ template, as opposed to a formatted theme, you must make all design decisions?
    15·1 answer
  • An automated search feature used by search engines to find results that match your search terms is called spider or
    13·1 answer
  • 1. Provide Java code for a simple class of your choice. Be sure to include at least one constructor, two methods and two fields.
    14·1 answer
  • this device can be used to type documents,send email,browse the internet,handle spreadsheets,do presentations,play games,and mor
    14·1 answer
  • You have just set up a new wireless network at your house, and you want to determine whether your Linux laptop has connected to
    13·1 answer
  • Consider the following two code segments. In both, assume that n is an integer variable that has been declared and initialized.
    10·1 answer
  • Susan uploads her newly created files on the web server using FTP. What should she ensure while uploading to prevent other users
    9·2 answers
  • A system analyst generally needs to have a number of skills. For example, technical and analytical skills are required for this
    7·1 answer
  • 11.5 Code Practice edhesive
    10·2 answers
  • Define computer memory and write it's type ​
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!