import java.util.Scanner;

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

		Scanner kb = new Scanner(System.in);

		System.out.print("Enter integer: ");
		int val1 = kb.nextInt();

		// print all values from 1 to val1 (inclusively)

		int currentValue = 1;

		while(currentValue <= val1) {
			System.out.println(currentValue);
			currentValue++;
		}


		System.out.println("...");
		// do same thing with for-loop

		for(int i = 1; i <= val1; i++) {
			System.out.println(i);
		}

		
		// get second value from user

		System.out.print("Enter integer: ");
		int val2 = kb.nextInt();
		

		// make sure val1 holds smaller value

		int temp = 0;
		if (val1 > val2) {
			temp = val1;
			val1 = val2;
			val2 = temp;
		}


		// use a for-loop to count how many integers 
		// between val1 and val2 are even

		int count = 0;
		for(int i = val1; i <= val2; i++) {
			if(i % 2 == 0) {
				count++;
			}
		}
		System.out.printf("num even: %d\n", count);

		// same 
		/*
		int i = val1;
		for(;i <= val2;i++) {
			if(i % 2 == 0) {
				count++;
			}
		}
		System.out.printf("i stops at %d\n", i);
		*/

		// print numbers that are divisible by 5 with
		// commas between

		for(int i = val1; i <= val2; i++) {
			if(i % 5 == 0) {
				System.out.printf("%d", i);
				if((i+4) < val2) {
					System.out.printf(",");
				}
			}
		}
		System.out.println();





	}
}
