question about terminating my loop
Hello All! I was hoping someone could tell me how to terminate my loop. The purpose of my program is to find the last position of "100" in the array that I am to create, and terminate the loop afterwards. My current output is 4 1. (I would like just 4)When I add "break ;" before System.out.println(i); , my new output becomes 5, and when I add it after this statement, there is no output. Does anyone have a suggestion? I'd appreciate it emensely =) .
publicclass Scores{
publicstaticint[] scores ={95, 100, 72, 88, 100, 86} ;
publicstaticvoid main(String[] args){
for (int i = 5 ; i >= 0 ; i--){
if (scores[i] == 100)
System.out.println(i) ;
}
}
}

