More Examples int sum Keeps adding the bers.2.3 .. until while( sum <=1000000)( the sum becomes larger than1.000.000 sum sum number umb umber 1 2 int product 1, numbe count 20, lastNumberi Computes the product of the first 20 odd integers lastNumber =2 while(number < lastNumber)( product product numberi number 2; C 2000 McGraw-Hill Introduction to Object-Oriented Programming with Java--Wu Chapter 7-6© 2000 McGraw-Hill Introduction to Object-Oriented Programming with Java--Wu Chapter 7 - 6 More Examples Keeps adding the numbers 1, 2, 3, … until the sum becomes larger than 1,000,000. Computes the product of the first 20 odd integers. int sum = 0, number = 1; while ( sum <= 1000000 ) { sum = sum + number; number = number + 1; } 1 int product = 1, number = 1, count = 20, lastNumber; lastNumber = 2 * count - 1; while (number <= lastNumber) { product = product * number; number = number + 2; } 2