// Example of a nested loop import java.util.Scanner; class ExampleNestedLoop { public static void main (String[] args) { Scanner scan = new Scanner (System.in); System.out.println(); System.out.print ("Enter a number between 5 and 10: "); int number = scan.nextInt(); System.out.println(); int count1 = number; int count2; while (count1 > 0) { count2 = 0; while (count2 < number) { System.out.print (count1 % 2 == 0 ? " even " : " odd "); ++count2; } --count1; System.out.println(); System.out.println(); } } }