/
/fdgdfg
Last edited on
That isn't valid C++. Nor does it match any of the instructions you've given.
1) Create an integer array of size 100 |
int anArray[100] { 0 };
2) Create a for-loop that input N integers ( N = 8 ) into the array |
1 2 3 4 5 6
|
const int N = 8;
for (int loop = 0; loop < N; loop++)
{
std::cout << "Enter the number: ";
std::cin >> anArray[loop];
}
|
3) Create another for-loop that finds the position of the element that has the smallest value in your array |
1 2 3 4 5 6 7 8 9 10
|
int min = anArray[0];
int pos = 0;
for (int loop = 1; loop < N; loop++)
{
if (min > anArray[loop])
{
min = anArray[loop];
pos = loop;
}
}
|
Last edited on
Topic archived. No new replies allowed.