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;
Comments
Leave a comment