Finding largest square less than a given number in Java [closed]

How about something like the following to get you going …

double x = 20;
double root = Math.sqrt(x);
int t = (int)root;
System.out.println("Root is:" + root + " and answer is :" + t*t);

Leave a Comment