Answer to Question #57832 in C++ for Ali hassan

Question #57832
write a program that inputs a series of 20 number and displays the minimum value
1
Expert's answer
2016-02-17T05:37:04-0500
Answer on Question#57832 — Programming | C++

#include <iostream>
using namespace std;

const int size = 20;

int main() {
int a[size];
int min;
for(int i = 0; i < size; i++) {
cin >> a[i];
}
min = a[0];
for(int i = 1; i < size; i++) {
if(a[i] < min) {
min = a[i];
}
}
cout << min;

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
APPROVED BY CLIENTS