1
for (int index = 0; index < 200; index++)
    {
        if(find_array[index] < minimums[0])
        {
            minimums[0] = find_array[index]; //Lowest number
            cout <<"The index is " << index << endl; // trying to find an index
        }
    }

    for (int index = 0; index < 200; index++)
    {
        if(find_array[index] < minimums[1] && find_array[index] > minimums[0])
        {
            minimums[1] = find_array[index]; //The NEXT Lowest number
            cout <<"The index is " << index << endl; // trying to find an index

        }


    }

I am trying to find the index of the smallest number.... Everything is fine but I couldnt find the index of it?

2
Contributors
3
Replies
13
Views
3 Years
Discussion Span
Last Post by chubbyy.putto
0

for example: The random number make 1 ..... 29.......34 .... 32..... 2...3......5......6: My code will print out: The smallest is 1 and this number locate at ???? and my 2nd smallest is at 2 and this number locate at ?????

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.