/* 
 * Math class
 * for-loop
 */

import java.util.Scanner;

class Sep12 {
	public static void main(String[] args) {

		/* In order to use Scanner's non-static methods, we
		   must create an instance of the Scanner class and
		   store the reference to the instance in a variable (kb).

		   In addition, we must import the Scanner class.
		*/

		Scanner kb = new Scanner(System.in);
		int val = kb.nextInt();

		/* To use the static methods of the Math class, we do not
		   need an instance of the class.  We can just use the Math
		   class name when we call the method.

		   In addition, we do not need to import the Math class.
		*/

		double x = 10.5;
		double absVal = Math.abs(x);


		/* while a bool_exp is true, execute block of code */
	
		/* Eg. print the numbers between 1 and 5 to the screen */

		/* Start by declaring a counting variable whose value will
		   change/count from 1 to 5.
		*/

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

		System.out.println("value of i after loop: " + i);
		System.out.println();
		
		
		// A for-loop simplifies the syntax of a while loop.
		// The loop below prints from 1 to 5, similar to the while-loop above
		
		for(int j = 1; j <= 5; j++) {
			System.out.println(j);
		}
		System.out.println();

		// print from 7 to 11

		for(int j = 7; j <= 11; j++) {
			System.out.println(j);
		}
		System.out.println();
		
		// print backwards from 11 to 7

		for(int j = 11; j >= 7; j--) {
			System.out.println(j);
		}
	}
}
