Ask Question
4 June, 17:56

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?

+3
Answers (1)
  1. 4 June, 21:03
    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 and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers