I have this loop here
for(int i =0; i < prices.length; i++)
{
if(prices[i]>largest)
{
largest = prices[i];
}
else if(prices[i]<smallest)
{
smallest= prices[i];
}
}
which loops through the whole array and finds the min and max value. Say I wanted to only loop through the first 20 elements how do I do that? I have tried along the lines of putting a nested loop in under this for loop and seeing if I come across it but I can't.