While compiling the code given below i encounter this syntax error:possible loss of precision
import java.lang.Math.*;
class delete
{
public static void main(int a)
{
int z=a;
int b=Math.sqrt(z);
System.out.println(b);
}
}
Please help!
Printable View
While compiling the code given below i encounter this syntax error:possible loss of precision
import java.lang.Math.*;
class delete
{
public static void main(int a)
{
int z=a;
int b=Math.sqrt(z);
System.out.println(b);
}
}
Please help!
Welcome to the forum. Please read this topic to learn how to post code correctly.
You could noodle this one out yourself by answering the question, "How often will the square root of a number be an integer?" Then you might look at the Math API to see what the sqrt() method returns.
You should give the question and your and desired output....so that we could determined what could we will make
Thanks buddy!:o