+91-85006-22255
Write a program to find the square root of a given number. If the given number is not a perfect square then return -1.
-1
1
2
9
3
15
625
25
class SquareRootOfNumber { public static void main(String s[]) { System.out.println("Square root of number 25 is " + squareRootOfNumber(25)); } public static int squareRootOfNumber(int input) { int result;
return result; } }
Topic: Using Break In for Loop To Exit
Read this topic Take test on this topic
Open In App