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
Murrr4er [49]
3 years ago
10

Write the definition of a function named maxmin that is passed four int arguments. The function returns nothing but stores the l

arger of the first two arguments in the third argument it receives and the the smaller of the first two arguments in its fourth argument. So, if you invoke maxmin(3,7,x,y), upon return x will have the value 7 and y will have the value 3.

Computers and Technology
1 answer:
photoshop1234 [79]3 years ago
6 0

Answer:

To get the values in x and y, we should use the pass -by -reference method. Where a reference to the actual variable is created in the called function. When we update the value inside the called function, it reflects in the calling function.

C++ code:

#include<iostream>

using namespace std;

void maxmin(int p, int q, int &r, int &s);

int main()

{

int k,l,x,y;

 

cout<<"Enter two integers for k and l: ";

cin>>k>>l;

 

maxmin(k, l, x, y);

 

cout<<"The maximum of two numbers is: "<<x<<endl;

cout<<"The minimum of two numbers is: "<<y<<endl;

}

void maxmin(int p, int q, int &r, int &s)

{   //r and s holding the address of x and y respectively.

if(p>q)

{

 r=p;

 s=q;

}

else

{

 r=q;

 s=p;

}

}

Explanation:

The program shows how the method is working and the output is

You might be interested in
Louis has entered a column of expense values. What feature can he use to insert the total expenses at the end of the column?
vovangra [49]
I think it’s B tho I’m not really sure
5 0
3 years ago
What is an input and output device? Give examples.​
yanalaym [24]

Answer:

input devices are a piece of equipment used to provide data to the computer examples:  mouse, keyboard, scanner, camera, etc

output devices are any piece of computer hardware equipment which converts information into a human readable form examples: printer, monitor, and others

6 0
3 years ago
What should a pie chart represent?
Crazy boy [7]

Answer:

Data that adds up to 100%

Explanation:

7 0
2 years ago
What statement best describes entrepreneurship?
RideAnS [48]

D. It requires creativity and ambition. I know its right

3 0
4 years ago
Read 2 more answers
Choose the correct function to yield the shown result.
HACTEHA [7]

Answer:

int

Explanation:

Correct on edg test 2021

8 0
3 years ago
Other questions:
  • Please help!
    10·1 answer
  • Atoms may be bonded together by losing, gaining or sharing _____________.
    7·1 answer
  • My tv is hdtv but it does not show the name of the channels
    15·1 answer
  • On the Excel Ribbon, click the Data tab in the Sort &amp; Filter Group, and then click the Sort button to conduct a _____ sort.
    8·1 answer
  • Dereck works for long hours on his computer. He frequently experiences physical strain by the end of the day because he does not
    13·2 answers
  • Which is an example of correct HTML? &lt;h1&gt; This is a heading&lt;/h1&gt;
    9·2 answers
  • A palindrome is a string that reads the same both forward and backward. For example, the string madam is a palindrome. Write a p
    13·1 answer
  • You are almost finished updating a Website. As part of the update, you have converted all pages from HTML 4.0 to HTML5. The proj
    7·1 answer
  • Does anyone have a pdf of the greatest by eddie van der meer????
    15·1 answer
  • Finish the program to compute how many gallons of paint are needed to cover the given square feet of walls. Assume 1 gallon can
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!