Code Below:
import java.util.*;
class perfectsquare
{
public static void main()
{
Scanner s=new Scanner(System.in);
int n,i,c=0;
System.out.println("enter a no.");
n=s.nextInt();
i=(int)Math.sqrt(n);
if (i*i==n)
System.out.println(n+"is perfect square");
else
System.out.println(n+"is not perfect square");
}
}