
import java.util.Scanner;

public class MoreLoops {

	public static void main(String[] args) {
		
		Scanner input = new Scanner(System.in);
		
		System.out.print("How many times? ");
		int max = input.nextInt();
		//start
		int count = 1;

		//do-while
		//body will be run at least once
		do {
			System.out.println(count); //repeat
			
			count++;  //next
		} while (count <= max);  //condition
		
		//counting loops - we know how many iterations
		
		//sentinel loop - repeat until we see a special value or condition
		
		int number = 0;
		int sum = 0;
		do {
			sum += number;
			
			System.out.print("Enter an int (0 to quit)");
			number = input.nextInt();
			
		} while (number != 0);  //go until the user types 0
		System.out.println("The sum is " + sum);
	}

}
