Ask Question

Write a program that asks the user how many integers they would like to enter. You can assume they will enter an integer> 1. The program will then prompt the user to enter that many integers. After all the numbers have been entered, the program should display the largest and smallest of those numbers (no, you cannot use arrays, or any other material we haven't covered). When you run your program it should match the following format: How many integers would you like to enter?

+2
Answers (1)
  1. 26 April, 18:40
    0
    Explanation:#include

    using namespace std;

    int main ()

    {

    int x, val, average = 0;

    cout << "how many integers you would like to enter: " << endl;

    cin >> x;

    for (int i=1; i<=x; i++)

    {

    cin >> val;

    average+=val;

    }

    cout << average/x << endl;

    return 0;

    #include

    using namespace std;

    int main ()

    {

    int x, val, average = 0;

    cout << "how many integers you would like to enter: " << endl;

    cin >> x;

    for (int i=1; i<=x; i++)

    {

    cin >> val;

    average+=val;

    }

    cout << average/x << endl;

    return 0;
Know the Answer?
Not Sure About the Answer?
Find an answer to your question 👍 “Write a program that asks the user how many integers they would like to enter. You can assume they will enter an integer> 1. The program ...” in 📗 Computers & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers