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
Karo-lina-s [1.5K]
4 years ago
5

Write a program that asks the user to enter five different, integer numbers. The program then reports the largest number and the

smallest number.
Computers and Technology
1 answer:
vovikov84 [41]4 years ago
5 0

Answer:

// here is code in C++.

#include <bits/stdc++.h>

using namespace std;

// main function

int main()

{

// variables

  int mi=INT_MAX;

   int mx=INT_MIN;

   int Num;

   cout<<"enter five different Numbers:";

   // read 10 non-negative Numbers

   for(int a=1;a<=5;a++)

   {

       // read the input number

       cin>>Num;

     // find maximum

       if(Num>mx)

       {

           mx=Num;

       }

       // find minumum

       if(Num<mi)

       {

           mi=Num;

       }

   }

   // print maximum and minimum

   cout<<"maximum of five numbers is: "<<mx<<endl;

   cout<<"minimum of five numbers is: "<<mi<<endl;

return 0;

}

Explanation:

Declare two variables "mi" & "mx" and initialize them with INT_MAX and INT_MIN respectively.Then read the five number from user and compare it with "mi" & "mx" ,if input is greater than "mx" then update "mx" or if input is less than "mi" then update the "mi". After all the inputs, "mi" will have smallest and "mx" will have largest value.

Output:

enter five different Numbers:6 19 3 44 23

maximum of five numbers is: 44

minimum of five numbers is: 3  

You might be interested in
If you ping a device, you are using the______protocol
meriva
Joystick..................:-)
6 0
4 years ago
You are attending to a neighbor who is unresponsive, not breathing normally, and pulseless. Your spouse has left to activate EMS
Novosadov [1.4K]

Answer:

inspect the CPR mask and make sure that the one-way valve is correctly in place.

Explanation:

Based on the information provided within the question it seems that the next logical step would be to inspect the CPR mask and make sure that the one-way valve is correctly in place. This valve allows oxygen to be pushed into the victim's lungs but does not pull the oxygen back through the valves, that is part of the chest compression's that the person performing the CPR needs to do.

3 0
3 years ago
any one that owns a chrome book there is a new update there is new features and there is a game on settings where you see what y
timama [110]

Answer:

THANK YOU SO MUCH! I AM ON MY CHROME BOOK RIGHT NOW AND WAS HESITATING TO DOWNLOAD THE UPDATE!

Explanation:

4 0
3 years ago
Read 2 more answers
What is the function of ctrl+Q​
vlabodo [156]

Answer:

Ctrl+Q is used to remove a paragraph's formatting

Explanation:

Hope that's the answer you're looking for!

5 0
3 years ago
Which of the following strategies will help you to stay focused and on topic while writing your essay?
AveGali [126]

Answer:

the answer is D,both A and B

8 0
3 years ago
Read 2 more answers
Other questions:
  • Show the contents of a queue after the following operations are performed. Assume the queue is initially empty. enqueue(45); enq
    6·1 answer
  • On what dates did the 2016 Olympics take place( list all)
    9·2 answers
  • Which markup language would be considered the most current for web design? HTLM, HTML5, XHTLM, XHTML 6
    14·2 answers
  • Which line of code will generate a random integer between 7 and 77?
    10·1 answer
  • If you are logged on to Windows Live Messenger, why would you be unable to engage
    6·1 answer
  • At Chicago Cubs games, residents across the street from Wrigley Field can watch the game from their apartment windows. Many of t
    14·1 answer
  • Adam is an Engineering student but has decided that he does not want to work in that field, but in the Manufacturing career clus
    11·2 answers
  • Which job qualifications are typical for someone who wants to work in Information Support and Services?
    8·2 answers
  • define a computer, state its 3 main activities with examples of the functions of each of those activities​
    7·1 answer
  • What would the input, process, outcome and feedback be for a class assignment
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!