import java.util.Scanner;

class Oct9 {

	public static void main(String[] args) {
		
		// count from 1 to 10 using a for-loop

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

		// print even numbers between two integers
		// read from the keyboard (inclusively)

		Scanner kb = new Scanner(System.in); 
		System.out.println("Enter 2 integers");
		int val1 = kb.nextInt();
		int val2 = kb.nextInt();

		// figure out which is lower
		int lowerBound = (val1 < val2) ? val1 : val2;
		int upperBound = (val1 >= val2) ? val1 : val2;

		for(int i = lowerBound; i <= upperBound; i++) {
			if(i % 2 == 0) {
				System.out.print(i + " ");
			}
		}
		System.out.println();
	
		int[] arr1 = {1,2,3};
		int[] arr2 = new int[5];

		// ask user for 5 integers, read from kb, 
		// store in arr2

		System.out.println("Enter 5 integers");
		for(int i = 0; i < arr2.length; i++) {
			arr2[i] = kb.nextInt();
		}
		
		printArray(arr2);	

		int[] row2 = {2,4,6};

		int[][] matrix = { {1,3,5}, row2, {2,1,0} };
		printMatrix(matrix);

	}

	static void printArray(int[] a) {
		for(int i = 0; i < a.length; i++) {
			System.out.printf("%d ", a[i]);
		}
		System.out.println();
	}

	static void printMatrix(int[][] m) {
		for(int[] row : m) {
			for(int elm : row) {
				System.out.printf("%d ", elm);
			}
			System.out.println();
		}
	}
}
