So I'm having some trouble with something. I have to create a function that will find the smallest number in an array. I know of one way to do it, using an overkill amount of if/else if, which won't do any good if the array size changes. I know using a for loop should do the trick but I can't figure out how to write it. Any push in the right direction would be greatly appreciated.
#include <iostream>
using namespace std;
int findLowest(int[]);
int main()
{
int AR[5] = {4, 87, 1, -3, 78};
cout << findLowest(AR);
return 0;
}
int findLowest(int AR[])
{
return lowest;
}
std::min_element.