beginner in c++ here , learning arrays. program below supposed return smallest , largest number in array using 2 separate functions. 1 largest , 1 smallest number. however, returning 0 time function lastlowestindex , unsure may doing wrong. could ever kindly advice , show me incorrect in function , can done correct returns correct value? not seeing and/or understanding incorrect. thank , time in advance!!! #include <iostream> #include <cstdlib> int lastlargestindex(int [], int); int lastlowestindex(int [], int ); using namespace std; int main() { const int n = 15; int arr[n] = {5,198,76,9,4,2,15,8,21,34,99,3,6,13,61}; int location; //int location2; location = lastlargestindex( arr, n ); cout << "the last largest number is:" << location << endl; location = lastlowestindex(arr, n); cout << "the last smallest number is:" << location << endl; // std::system ("pause"); ...
Comments
Post a Comment