Answer to Question #272751 in C++ for ujoo

Question #272751

Write a program that fills an integer array of 10 numbers From the user in an array Then print out the smallest number


1
Expert's answer
2021-11-28T11:44:26-0500
#include <iostream>
using namespace std;


int arr[10], mn;


int main()
{
    for (int i = 0; i < 10; i++) {
        cin >> arr[i];
    }
    mn = arr[0];
    for (int i = 0; i < 10; i++) {
        if (arr[i] < mn) {
            mn = arr[i];
        }
        
    }
    cout << "Min: " << mn;
    return 0;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS