Ask Question
8 July, 18:20

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. 8 July, 20:06
    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?
Get 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 there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers