+ 1
How to check whether a number is perfect square or not using scanner class in java
I am a class 9 student,so plz help me
2 Réponses
+ 1
You would need to use for loop to check:
0 * 0
1 * 1
2 * 2
3 * 3
...
If the result will ever equal to the given value, the value is a perfect square.
Else if the result is greater than the given value, and if the result was never equal, the value is not perfect square.
+ 1
Thanks for helping,but I got better logic