Write a C program that takes numbers from the user puts them

Write a C++ program that takes numbers from the user, puts them into an array, sends the array to a function. The function must reurn the smallest number.

This is basic101 class so please do not write a very big program. Thanks

Solution

#include using namespace std; int a (int[]); int main () { const int Numb = 12; int i; int a[Numb]; int max = a[0]; int min = a[0]; for (i = 0; i < 12; i++) { if (a[i] > max) { max = a[i]; } else if (a[i] < min) { min = a[i]; } } cout << max << endl; cout << min << endl; return 0; }
Write a C++ program that takes numbers from the user, puts them into an array, sends the array to a function. The function must reurn the smallest number. This

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site