Program to find the square root of a number in java
Answers
Answered by
4
HEYY FRIEND!
Program to find square root of a number?
Here's your code:
import java.util.*;
class SquareRoot
{
public static void main (String args[])
{
Scanner sc = new Scanner (System.in);
System.out.print("Enter the number: ");
int num = sc.nextInt();
double ans;
ans = Math.sqrt(num);
System.out.println("Square root of " + num + " is: " + ans);
}
}
THANKS (^_^)
Program to find square root of a number?
Here's your code:
import java.util.*;
class SquareRoot
{
public static void main (String args[])
{
Scanner sc = new Scanner (System.in);
System.out.print("Enter the number: ");
int num = sc.nextInt();
double ans;
ans = Math.sqrt(num);
System.out.println("Square root of " + num + " is: " + ans);
}
}
THANKS (^_^)
Similar questions