Write a function namedadd_complex that adds the correspondingnumbers of its arguments (both complexstructures), then returns the result (anothercomplex structure)

Answers

Answer 1
Answer:

Answer:

#include <iostream>

using namespace std;

struct complex{//structure of comlex number..

double real;

double img;

};

complex add_complex(complex n1,complex n2)//add_complex functrion to add 2 complex numbers..

{

   double a,b;//variables to hold the sum of real and imaginary.

   complex sum;//result sum complex number.

   a=n1.real+n2.real;//adding real parts.

   b=n1.img+n2.img;//adding imaginary parts..

   sum.real=a;//assinging values to sum.

   sum.img=b;

   return sum;//returning complex number sum.

}

int main()

{

 complex c1,c2,sum;

 double a,b;

 cout<<"Enter values of c1"<<endl;

 cin>>a>>b;

 c1.real=a;

 c1.img=b;

 cout<<"Enter values of c2"<<endl;

 cin>>a>>b;

 c2.real=a;

 c2.img=b;

 sum=add_complex(c1,c2);

 cout<<"The sum is : "<<sum.real<<" + i"<<sum.img<<endl;

 return 0;

}

OUTPUT:-

Enter values of c1

8.5 7.2

Enter values of c2

4.5 3.9

The sum is : 13 + i11.1

Explanation:

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


Related Questions

The scope of a variable declared inside of a function is:a) Local - within that functionb) Within that file onlyc) global
To define constructors and member functions outside of a class's original scope, the operator can be used.
Define the role of websites in internet.also write the importance of internet in our daily life.
Is the willingness to put a customer’s needs above ones own needs and to go beyond a job description to achieve customer satisfaction
35. (a) Identify some key internet search engines​

What is the second stage of information processing cycle​

Answers

Answer:

the second stage of information processing cycle is processing.

sry but IAM not correctly sure....

Explanation:

The sequence of events in processing information, which includes (1) input, (2) processing, (3) storage and (4) output. The input stage can be further broken down into acquisition, data entry and validation. The output stage can also be further divided into interactive queries and routine reports.

pls Mark me as brainliest trust me

The sql standard prescribes three different types of __________ operations: left, right, and full.

Answers

The sql standard prescribes three different types of JOIN operations: left, right, and full.
 
The LEFT [OUTER] JOIN yields all rows with matching values in the join columns, plus all ofthe unmatched rows from thelefttable.
The RIGHT [OUTER] JOIN yields all rows with matching values in the join columns, plus all ofthe unmatched rows from therighttable.
 The FULL [OUTER] JOIN yields all rows with matching values in the join columns, plus all theunmatched rows from both tables named in the FROM clause.

Cloud storage refers to the storage of data on ______.a. your mobile device.b. your desktop computer.c. an external drive.d. a server on the Interne.

Answers

The correct answer is:

Cloud storage refers to the storage of data on a server on the internet.

Every organization relies on data, In our daily job, we all make use of a huge amount of data(either in gigabytes or terabytes). And if you have a lot of files on your computer, it's probable that your computer may lose momentum and slow down, resulting in bad performance. While there are several external storage options available for storing and backing up your data, these devices are not infallible. Any incident, such as theft, or damage, might result in the loss of vital data.

This is where Cloud Storage comes into play. Cloud storage is a handy and dependable method of storing and retrieving information on the internet.

It is a cloud computing system in which data is stored on the server-side of the Internet and is managed and operated by a cloud computing provider. 

Therefore, from the above explanation, we can conclude that the correct Option is D

Learn more about Cloud Storage here:

brainly.com/question/23073532?referrer=searchResults

Answer:

D.  server on the internet

Explanation:

Seasons Write a program that takes a date as input and outputs the date's season. The input is a string to represent the month and an int to represent the day. Ex: If the input is April 11, the output is: spring In addition, check if the string and int are valid (an actual month and day). Ex: If the input is invalid, the output is: invalid The dates for each season are: spring: March 20 - June 20 summer: June 21 - September 21 autumn: September 22 - December 20 winter: December 21 - March 19

Answers

Answer:

#include <iostream>

#include <string>

using namespace std;

int main() {

   string inputMonth;

   int inputDay;

   cin >> inputMonth >> inputDay;

   if (inputMonth == "January" && inputDay >= 1 && inputDay <= 31)

       cout << "Winter" << endl;

   else if (inputMonth == "February" && inputDay >= 1 && inputDay <= 29)

       cout << "Winter" << endl;

   else if (inputMonth == "April" && inputDay >= 1 && inputDay <= 30)

       cout << "Spring" << endl;

   else if (inputMonth == "May" && inputDay >= 1 && inputDay <= 30)

       cout << "Spring" << endl;

   else if (inputMonth == "July" && inputDay >= 1 && inputDay <= 31)

       cout << "Summer" << endl;

   else if (inputMonth == "August" && inputDay >= 1 && inputDay <= 31)

       cout << "Summer" << endl;

   else if (inputMonth == "October" && inputDay >= 1 && inputDay <= 31)

       cout << "Autumn" << endl;

   else if (inputMonth == "November" && inputDay >= 1 && inputDay <= 30)

       cout << "Autumn" << endl;

   else if (inputMonth == "March" && inputDay >= 20 && inputDay <= 31)

       cout << "Spring" << endl;

   else if (inputMonth == "June" && inputDay >= 1 && inputDay <= 20)

       cout << "Spring" << endl;

   else if (inputMonth == "June" && inputDay >= 21 && inputDay <= 30)

       cout << "Summer" << endl;

   else if (inputMonth == "September" && inputDay >= 1 && inputDay <= 21)

       cout << "Summer" << endl;

   else if (inputMonth == "September" && inputDay >= 22 && inputDay <= 30)

       cout << "Autumn" << endl;

   else if (inputMonth == "December" && inputDay >= 0 && inputDay <= 20)

       cout << "Autumn" << endl;

   else if (inputMonth == "December" && inputDay >= 21 && inputDay <= 30)

       cout << "Winter" << endl;

   else if (inputMonth == "March" && inputDay >= 1 && inputDay <= 19)

       cout << "Winter" << endl;

   else

       cout << "Invalid" << endl;

   return 0;

}

Answer:

FOR PYTHON!!

input_month = input()

input_day = int(input())

months= ('January', 'February','March', 'April' , 'May' , 'June' , 'July' , 'August' , 'September' , "October" , "November" , "December")

if not(input_month in months):

   print("Invalid")

elif input_month == 'March':

   if not(1<=input_day<=31):

       print ("Invalid")

   elif input_day<=19:

       print("Winter")

   else:

       print ("Spring")

elif input_month == 'April' :

   if not(1<=input_day<=30):

       print("Invalid")

   else:

       print("Spring")

elif input_month == 'May':

   if not(1<=input_day<=31):

       print("Invalid")

   else:

       print("Spring")

elif input_month == 'June':

   if not(1<=input_day<=30):

       print("Invalid")

   elif input_day<=20:

       print ("Spring")

   else:

       print("Summer")

elif input_month == 'July':

   if not(1<=input_day<=31):

       print("Invalid")

   else:  

       print("Summer")

       

elif input_month == 'August':

   if not(1<=input_day<=31):

       print("Invalid")

   else:  

       print("Summer")

elif input_month == 'September':

   if not(1<=input_day<31):

       print("Invalid")

   elif input_day<=21:

       print ("Summer")

   else:

       print ("Autumn")

elif input_month == "October":

   if not(1<=input_day<=31):

       print("Invalid")

   else:

       print("Autumn")

elif input_month == "November":

   if not(1<=input_day<=30):

       print("Invalid")

   else:

       print ("Autumn")

elif input_month == "December":

   if not(1<=input_day<=31):

       print("Invalid")

   elif input_day <=20:

       print ("Autumn")

   else:

       print ("Winter")

elif input_month == 'January':

   if not(1<=input_day<=31):

       print("Invalid")

   else:

       print("Winter")

elif input_month == "February":

   if not(1<=input_day<=29):

       print("Invalid")

   else:

       print ("Winter")

Explanation:

Good luck in the rest of your class!

What character makes an assignment statement an assignment statement?

Answers

Answer:

'='

Explanation:

The equal ('=') is the character that is used to assign the value in the programming.

In the programming, there is a lot of character which has different meaning and uses for a different purpose.

like '==' it is used for checking equality between the Boolean.

'+' is a character that is used for adding.

'-'  is a character that is used for subtraction.

similarly, '=' used for assigning.

for example:

a = a + b;

In the programming, the program evaluates the (a + b) first and then the result assigns to the variable.

When you are creating a certificate, which process does the certificate authority use to guarantee the authenticity of the certificate

Answers

Answer:

Verifying digital signature

Explanation:

In order to guarantee authenticity of digital messages an documents, the certificate authority will perform the verification of the digital signature. A valid digital signature indicates that data is coming from the proper server and it has not been altered in its course.