Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 9th, 2012  |  syntax: None  |  size: 0.34 KB  |  hits: 16  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1.  
  2. public class Example {
  3.  
  4.   public static void main(String [] args){
  5.  
  6.  int[] numbers = new int[]{1,2,3,4,5,6,7,8,9,10,11,12};
  7.  int x = 0;
  8.  while(x<numbers.lenth){
  9.  
  10.   if(numbers[x]%2 == 0)
  11.    System.out.println(numbers[x]+ " is even");
  12.  
  13.  
  14.   else
  15.    System.out.println(numbers[x]+ " is odd");
  16.  
  17.      x = x + 1;
  18.  
  19.     }
  20.  }
  21. }