so I have and for loop to find the highest number in and array how would i go about outputting the element number?

//compares the values in the yearAverage array to find the highest temperature
	for(int i=0; i<lineCount; i++)
			highTemp = yearAverage[i];


add another variable to keep track of the element number and use it just like you do highTemp variable that appears on line 6 of the code you posted.

how would i do the element number then just like

element = i

inside the if statement?

thanks for the help ended up being exactly what i thought thanks for pointing me in the right direction