for (i = 0, i < NUM_ROWS; i++;){
for (j = 0, j < NUM_COLS; j++;){
if (milesTracker[i][j] > maxMiles)
maxMiles = milesTracker[i][j];
if (milesTracker[i][j] < minMiles)
minMiles = milesTracker[i][j];
}
}
maxMiles & midMiles both given/initialized at 0 before the nested loop. When I run it (cout << minMiles), it only gives back a zero for either, no matter the inputs.
Where is my logic flawed here? It should go:
- Go through each number in the array
- First time, is it larger than zero, if so then make it the new number.
- Loop, repeat, until over.
Currently having to pay for my sins from CompSci 1 in CompSci 2, so I'm just trying to review what I never learned...