سؤال 4.13 من الكتاب:
(Finding the largest n such that n^3>12,000) Use a while loop to find the largest
integer n such that n^3 is less than 12,000.
الحل:
كود PHP:
int i=0;
while(Math.pow(i, 3) < 12000){
i++;
if (Math.pow(i, 3) > 12000){
System.out.println(--i);
break;}
}