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

MinMax is a function that takes five arguments and returns no value. The first three arguments are of type int. The last two arg

uments are pointers to int that are set by the function to the largest and smallest of the values of the first three parameters, respectively. x, y and z are three int variables that have been declared and initialized. big and small are two int variables that have been declared. Write a statement that sets the value of big to the largest of x, y, z and sets the value of small to the smallest of x, y, z by calling minMax.
Computers and Technology
1 answer:
Luba_88 [7]3 years ago
5 0

Answer:

#include <iostream>

using namespace std;

void MinMax(int x,int y,int z,int *max,int *min)

{

   int big,small;

   if((x>y)&&(x>z))    //to check for maximum value

       big=x;

   else if((y>x)&&(y>z))

       big=y;

   else

       big=z;

   if((x<y)&&(x<z))  //to check for minimum value

       small=x;

   else if((y<x)&&(y<z))

       small=y;

   else

       small=z;

   *max=big;   //pointer pointing to maximum value

   *min=small;     //pointer pointing to minimum value

}

int main()

{

   int big,small;

   MinMax(43,29,100,&big,&small);    

   cout<<"Max is "<<big<<"\nMin is "<<small;  //big and small variables will get value from method called

   return 0;

}

OUTPUT :

Max is 100

Min is 29

Explanation:

When the method is called from first three integers maximum will be found using the conditions imposed and maximum value will be found and similarly will happen with the minimum value.

You might be interested in
Unscramble the words <br><br> A: ESUOM RETUPOC <br><br> B: KSID EVIRD
Mrrafil [7]
A. Mouse coputer
B. Disk drive
5 0
4 years ago
Read 2 more answers
How long can a lightning last
Maru [420]
A lightning can last 30 microseconds.
8 0
4 years ago
How do I get rid of the thing on top? It is driving me INSANE!!
Zinaida [17]
Try restarting your laptop?
7 0
3 years ago
What is the instruction phase of the central processing unit​
belka [17]

Answer:

The instruction cycle (also known as the fetch–decode–execute cycle, or simply the fetch-execute cycle) is the cycle that the central processing unit (CPU) follows from boot-up until the computer has shut down in order to process instructions.

7 0
3 years ago
When pasting a circle drawn by the presentation software drawing tool into a spreadsheet, that circle will go into the selected
ivann1987 [24]
The answer is ............................ False
6 0
3 years ago
Read 2 more answers
Other questions:
  • _____ is two or more connected computers.
    8·1 answer
  • What are some of the challenges that could arise from setting up a file management system on a computer
    14·1 answer
  • WILL GIVE  BRAINLIEST!! WILL REPORT TOO....
    13·1 answer
  • What does the hexadecimal number 2D represent in the binary system?
    9·1 answer
  • Which biometric technique is considered nearly infallible from a scientific point of view and is increasingly preferred by crimi
    8·1 answer
  • We discussed making incremental dumps in some detail in the text. In Windows it is easy to tell when to dump a file because ever
    5·1 answer
  • I need help picture above
    14·2 answers
  • Dispositivo de computo
    5·1 answer
  • What is a common citation style used by students for English classes?
    5·1 answer
  • How does applying Fontworks effects to text on an advertising flyer change the text?
    14·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!