import java.util.Scanner;

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

		// read in characters from the keyboard (and print to screen)
		//  until 'x' is read

		Scanner kb = new Scanner(System.in);

		// use while-loop

		char input = '\0';

		while(input != 'x') {

			System.out.print("Enter character (x to stop): ");
			input = kb.next().charAt(0);

			System.out.println("choice entered: " + input);
		}

		// print every even number from 1 to 100 (inclusively)

		int i = 1;
		while(i <= 100) {
			if (i % 2 == 0) {
				System.out.print(i + " ");
			}
			i++;		
		}
		System.out.println();

		// count number of odd numbers between 1 and 100 (exclusively)
		// and compute the sum of odd numbers...

		int counter = 0;
		int sum = 0;
		i = 2;
		while(i < 100) {
			if (i % 2 == 1) {
				counter++;
				sum = sum + i;   //alt: sum += i;
			}
			i++;
		}
		System.out.println("num odd: " + counter);
		System.out.println("sum: " + sum);



	}
}
