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
Write its features:features of computer ​
Digiron [165]

Answer:

There are different characteristics of a computer is the following below.

Speed.

Accuracy.

Diligence.

Reliability.

Versatility.

Storage Capacity.

Automatic.

Quick Decision.

Explanation:

Sorse  

System https://quicklearncomputer.com

Mark brainlist if you want ¯\_(ツ)_/¯

5 0
2 years ago
Is a book considered technology?
kumpel [21]
Yes, "technology" doesn't have to be all about computers or cell phones.. Technology is anything that is a new advance in knowledge and books were once a great advance in that field.
7 0
3 years ago
Read 2 more answers
Which of the following common software packages would help a business
Jobisdone [24]

Answer:

D. Spreadsheets

Explanation:

While A also seems correct, a spreadsheet is best at collecting and organizing data. Databases would only store data while a spreadsheet would keep those records, as well as help calculate a budget or payroll.

3 0
2 years ago
A continuous and differentiable function f(x) with the following properties: f(x) is decreasing at x=−5 f(x) has a local minimum
butalik [34]

The continuous and differentiable function where f(x) is decreasing at x = −5 f(x) has a local minimum at x = −2 f(x) has a local maximum at x = 2 is given as: y = 9x - (1/3)x³ + 3.

<h3>What is a continuous and differentiable function?</h3>

The continuous function differs from the differentiable function in that the curve obtained is a single unbroken curve in the continuous function.

In contrast, if a function has a derivative, it is said to be differentiable.

<h3>What is the solution to the problem above?</h3>

It is important to note that a function is differentiable when x is set to a if the function is continuous when x = a.

Given the parameters, we state that

f'(5) < 0; and

x = -5

The local minimum is given as:
x = -3;

the local maximum is given as

x = 3

Thus, x = -3 ; alternatively,

x = 3.  With this scenario, we can equate both to zero.

Hence,

x + 3 = 0;

3-x = 0.

To get y' we must multiply both equations to get:

y' = (3-x)(x + 3)

y'   = 3x + 9 - x² - 3x

Collect like terms to derive:

y' = 3x - 3x + 9 - x²; thus

y' = 9-x²

When y' is integrated, the result is

y = 9x - (x³/3) + c

Recall that

F (-5) < 0

This means that:

9 x -5 - (-5³/3) + c < 0
⇒ -45 + 125/3 + c <0
⇒ -10/3 + c < 0

Collecting like terms we have:
c < 10/3; and

c < 3.33


Substituting C into

f(x) = 9x - x³/3 + c; we have

f(x) = 9x - x³/3 + 3, which is the same as  y = 9x - (1/3)x³ + 3.

Learn more about differentiable functions at:
brainly.com/question/15047295
#SPJ1

7 0
2 years ago
The range of a finite nonempty set of $n$ real numbers $S$ is defined as the difference between the largest and smallest element
-Dominant- [34]

Answer: Hello your question is poorly written attached below is the well written question

answer:

a) Determine ( compute ) the difference between the max and minimum value. determine the Min and max values using 1.5n comparisons

  time efficiency = θ( n )

b) A(n-1) - A(0)

  time efficiency = θ( 1 )

Explanation:

a) An unsorted array

To find the maximum and minimum values scan the array of elements , then determine ( compute ) the difference between the max and minimum value. to determine the range. Alternatively determine the Min and max values using 1.5n comparisons

Algorithm's time efficiency = θ( n )

b) A sorted array

To determine the range, we will determine the difference between the first and last element i.e. A(n-1) - A(0)

time efficiency = θ( 1 )

7 0
2 years ago
Other questions:
  • Smartart and shapes are useful tools because they allow you to
    10·1 answer
  • A company has developed a business-critical system for its core automation process with a software vendor. Which of the followin
    12·1 answer
  • Write the sql command to show which tutor needs to be reminded to turn in reports.
    13·1 answer
  • A company uses the account code 669 for maintenance expense. However, one of the company's clerks often codes maintenance expens
    15·1 answer
  • Managing your calendar and emails can be easily accomplished through ___ software
    8·1 answer
  • To access your gradebook you click on the __________.
    6·2 answers
  • Why must you be careful when handling a hard drive?
    10·1 answer
  • Since the rules cannot address all circumstances, the Code includes a conceptual framework approach for members to use to evalua
    8·1 answer
  • A security administrator plans to conduct a vulnerability scan on the network to determine if system applications are up to date
    15·1 answer
  • A 4"x6" photo is digitized using 10,000 pixels. An 11"x7" photo is digitized using 30,000 pixels. Which image will have the bett
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!