Find the largest n such that n cubed is less than a positive
     Find the largest n such that n cubed is less than a positive integer entered by the user. Use a while loop to find the largest integer n. Enter an integer: 3 4 5 6 7 8 The largest n such that n^3 is less than 345678 is 70 Type your solution here... 
  
  Solution
import java.util.*;
public class LargestNCubed {
public static void main(String[] args){
Scanner scan = new Scanner(System.in);
System.out.print(\"Enter an integer:\");
int n = scan.nextInt();
int ans = 0,temp=0;
while(ans*ans*ans<n)
{
temp=ans;
ans++;
}
System.out.println(\"The largest n that n^3 is less than \"+n+\" is \"+temp);
}
}

