/* 5.12: Find the smallest n such that n^2 > 12000 * 5.13: Find the smallest n such that n^3 > 12000 * Both solutions will use a while loop */ public class Prog5_12_And_5_13 { public static void main(String[] args) { int n = 0; // initialize n while(n*n<=12000) // increment n until n*n exceeds 12000 n++; System.out.println("The smallest n such that n^2 > 12000 is " + n); n = 0; // reset n for second computation while(n*n*n<=12000) // increment n until n*n*n exceeds 12000 n++; System.out.println("The smallest n such that n^3 > 12000 is " + n); } }