// varargs, precedence, do-while

import java.util.Scanner;

class Oct14 {

	public static void main(String ... args) {

		System.out.println(((2 + 3)* 5) % 2);

		int i = 0;
		while(i < 5) {
			System.out.print(i++ + " ");
		}
		System.out.println();

		// possible for body of while-loop to never be executed
		/*while(false) {
			System.out.println("print me");
		}
		*/

		// body of do-while is executed at least once
		i = 0;
		do {
			System.out.print(i++ + " ");
		} while(i < 5);
		System.out.println();
				

		// menu system

		/*

		String command = null;
		do {
			// print menu
			// get input from user
			// execute code based on input
		}
		while(command != "exit");

		*/

		printSum(1,2);
		printSum(1,2,3);

	}
	
	static void printSum(int ... args) {
		// args is an array of integers

		int sum = 0;
		for (int elm : args) {
			sum += elm;
		}
		System.out.println(sum);
	}


}






