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
What are some “creatures/animals” that Rex imitates?
Fantom [35]
For the answer to the question above, the Rex, robot imitates the dinosaur perfectly. In terms of its structure, the robot looks like a dinosaur, and this is seen in the robot’s serrated teeth. To some extent, the robot imitates the cheetah due to its speed ability. I hope this helps.

7 0
3 years ago
How to give answer like this?????
creativ13 [48]

Answer:

possibly he made an image in the photo or this

Explanation:

\large\boxed{\mathfrak{hi}}

8 0
3 years ago
What does the following code do? Assume "list" is an array of int values, "temp" is some previously initialized int value, and "
____ [38]

Answer:

Counting the number of elements in the array list smaller than temp.

Explanation:

We have an array list,a previously initialized integer temp and a an integer c initialized with 0.

In the code a for loop is used to iterate over the array and it is checking if the element at jth index is less than temp if it is then increasing the variable c by 1.

Hence when the loop ends the c will be having the count of the integers in array list that are smaller than temp.

6 0
4 years ago
Which command is used to combine two or more cells together into one cell?
Tju [1.3M]
B is your answer I believe
5 0
3 years ago
Read 2 more answers
What is the impact of Customer Centricity?
skad [1K]
Customer-centric businesses generate greater profits, increased employee engagement, and more satisfied customers. Customer-centric governments and nonprofits create the resiliency, sustainability, and alignment needed to fulfill their mission.
5 0
2 years ago
Other questions:
  • The ________ model allows the owner of a resource to manage who can or cannot access the item. Owners maintain this access throu
    8·1 answer
  • What are the two major categories of computer software? word-processing software and spreadsheet software applications software
    13·1 answer
  • Samantha received a gaming session as a gift. She would like to have it communicate with her sister Jennifer’s gaming system so
    15·1 answer
  • 4. How does distance affect the strength of the force of gravity?_
    5·1 answer
  • A foreach statement can be used in place of the for statement whenever code looping through an array requires "access" to the co
    10·1 answer
  • An administrator has several cables plugged into a patch panel and needs to determine which one comes from a specific port. Whic
    15·1 answer
  • In ____________, a large address block could be divided into several contiguous groups and each group be assigned to smaller net
    7·1 answer
  • अस्स्मन्चचरे ------------------- दृश्यते |
    8·1 answer
  • What do you understand by Multiprotocol Label Switching, how it works and is helpful in today's network scenario.
    15·1 answer
  • Which of the following represents a transition?
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!