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
blondinia [14]
3 years ago
14

Define a void function that calculates the sum (+), difference (-), product (*), quotient (/), and modulus (%) of two integer nu

mbers that would be passed through parameter list. The function returns the results back to the caller (main) through reference parameters. Define another function that simply displays the result.
Computers and Technology
1 answer:
BabaBlast [244]3 years ago
7 0

Answer:

#include <iostream>

using namespace std;

void multipurpose(int &num1,int &num2,int &add,int &subt,int &multi,int &divi,int &modulo )

{

   add=num1+num2;//adding two numbers...

   subt=abs(num1-num2);//subtracting two numbers...

   multi=num1*num2;//multiplying two numbers...

   divi=num1/num2;//Finding quotient of two numbers...

   modulo=num1%num2;//Finding modulo of two numbers...

}

void print(int add,int sub,int divi,int multi,int modulo) //function to print the values.

{

   cout<<"The addition is "<<add<<endl<<"The subtraction is "<<sub<<endl

   <<"The quotient is "<<divi<<endl<<"The multiplication is "<<multi<<endl

   <<"The modulus is "<<modulo<<endl;

}

int main() {

   int a,b,sum=0,mult=0,divi=0,sub=0,modulo=0;

   cin>>a>>b;

   multipurpose(a,b,sum,sub,mult,divi,modulo);

   print(sum,sub,divi,mult,modulo);

return 0;

}

Enter the numbers

12 12

The addition is 24

The subtraction is 0

The quotient is 1

The multiplication is 144

The modulus is 0

Explanation:

I have created a function multipurpose that has a argument list of two numbers ,and variables for addition,subtraction,multiplication,Division,Modulus and these all are passed by reference.Since the function is of type void so it cannot return anything so the only way to store the result is by passing the variables to store the results by  reference.

The other function print has the arguments of all the results here you can pass them by value or by reference because you only need to print the results.

You might be interested in
A(n) ________ is a chart based on PivotTable data.
Mrrafil [7]
Well since it’s a chart based on a PivotTable prettyyyy sure it’s gonna be a PibltChart
7 0
2 years ago
When a number gets assigned to a variable that already has a value __________?
Aleksandr-060686 [28]
A already assigned variable cannot be assigned twice You can make the variable change over to a new one or call a whole new one to assign one without a value or It might be possible to do v=n (v is variable and n is number / value)
3 0
2 years ago
Which one of the following oscilloscope controls is used to move the trace up and down the screen vertically? A. Focus B. Sweep
irga5000 [103]
The answer is A Focus hope it helps
7 0
2 years ago
Read 2 more answers
you arrive at a scene where a computer must be seized as evidence. the computer is powered off and has an external usb hard driv
larisa [96]

The first thing that must be done is Thoroughly documenting the state of equipment before it is hidden is critical to adhere to chain-of-custody procedures. Failure to do so will render collected evidence inadmissible.

Security+ can be defined as the entry-level cybersecurity credential offered by the CompTIA non-profit trade association. This is usually the first certification in information security that an IT professional obtains. By having this, you may get more job opportunities, because you are judged as a more competitive candidate.

The CompTIA Security+ exam (SY0-601) is a test that tests an applicant that he or she has the basic knowledge to perform tasks in IT security and work in cybersecurity. The CompTIA Security+ exam is a vendor-neutral exam that tests applicants' knowledge of IT security materials and their ability to perform core security functions.

You can learn more about Security+ here brainly.com/question/17109203

#SPJ4

7 0
1 year ago
Question 24 Multiple Choice Worth 5 points)
Veseljchak [2.6K]

Answer:

ZIP

Explanation:

ZIP is a type of compression file as Jpg is a picture file, Gif is a picture file, and ODOC stands for Oklahoma Department of Corrections

TBH:

it may be O ZIP but i've never heard of it.

8 0
3 years ago
Read 2 more answers
Other questions:
  • You have connected thirteen pcs and laptops to a wireless network. to make your wlan more secure, what should you do to disallow
    11·1 answer
  • Which of the following is a beneficial reason to extract mineral resources from the earth?
    13·2 answers
  • When adding a background to a Web page, it can be _____. a. a solid color b. a fill effect c. an image d. all of the above
    12·1 answer
  • Explain briefly the purpose of the Computer Management Console in Microsoft Windows.
    12·1 answer
  • Laxmi was not confident that she could learn to program a computer. When she found out that two girls with similar GPA’s in her
    5·1 answer
  • One of the most common uses of spreadsheet are
    8·1 answer
  • 14. In cell B14, create a formula without using a function that adds 1 to the value in cell B12 and then multiplies the result b
    9·1 answer
  • A simple C program to find the logarithm of any number in any base.....​
    13·1 answer
  • THIS IS TIMED PLS HURRY UP
    7·1 answer
  • if you want to clear a single file, what move instruction would you use? group of answer choices none of the choices file to wor
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!