/* * Stephen Boudreau * March 1,2011 * print out even + odd numbers */ package even_odd; /** * * @author Stephen Boudreau */ // <editor-fold defaultstate="collapsed" desc="find even odd"> public static void main(String[],boolean "if even else odd" args){ { // </print out even or odd numbers> // find the even + odd numbers public static void main(String args[], boolean "if even else odd"){ // variable declarations int num1; // even number int num2; // odd number // create Scanner to capture input from console Scanner input = new Scanner(System.in); // get user input, num1 and num2 and num3 System.out.print("enen number "); num1 = input.nextInt(); System.out.print("odd number: "); num2 = input.nextInt(); // Compare and determine the smallest number if (num1 > num2) even = num2; if (num1 < num2) odd = num1; // find the even + odd number even = (num1 + num2 ) /2; odd = (num1 + num2 ) /2; // Display average and the samllest System.out.printf("even"); System.out.printf("odd"); // run: } }

This post has been edited by **macosxnerd101**: 02 March 2011 - 09:18 AM

Reason for edit:: Please use code tags