What does the counter++ do? [closed]

sdasdadw

New Member
import java.util.Scanner;public class john { public static void main(String[] args){\[code\] Scanner input = new Scanner(System.in); int total = 0; int grade; double average; int counter =0; while ( counter < 10){ grade = input.nextInt(); total = total + grade; counter++; } average = total/10; System.out.println("Your average is " + average);}\[/code\]}Hey guys, I have been watching this tutorial series and I'm confused by something. The code works and everything, but I don't really understand what "counter++" does. The guy in the video says it's to exit the loop. What does this mean? Thanks!
 
Top