The question is as follows:
Write a C++ Program that ask the user to enter array size, then declare an integer array with the same size that the user entered.
For the declared array ask the users to enter the numbers inside the array then, find the index of the smallest element in the array.
Finally, your program should print the value of the smallest index.
#include <cstdlib>
#include <iostream>
usingnamespace std;
int main()
{
int s; // s = size number
int index=0;
int array [s];
cout<<" Please enter the size number of your array: ";
cin>>s;
for (int i=1;i<=s;i++)
cin>>array[i];
for (int i=1;i<=s;i++)
if (array[i]<array[index])
index=i;
cout<<" The minimum value in your array is :"<<endl;
cout<<array[index];
system("PAUSE");
return EXIT_SUCCESS;
}