
python - Check if a number is a perfect square - Stack Overflow
How could I check if a number is a perfect square? Speed is of no concern, for now, just working. See also: Integer square root in python.
How to find out if a number is a perfect square without using sqrt ...
Aug 1, 2019 · I have to write a program that finds out whether or not a number is a perfect square. The terms are I don't use a sqrt function or an exponent (**) I previously showed my teacher …
How do I find perfect square from a set of numbers in Java?
Sep 24, 2019 · A perfect square is a number that can be expressed as the product of two equal integers so it must be an int after the sqrt. If you do a sqroot*sqroot == num you are just …
Optimized way to find if a number is a perfect square
I had a question in my assignment to find whether a number was perfect square or not: Perfect square is an element of algebraic structure which is equal to the square of another element. …
python - Finding perfect square - Stack Overflow
So any positive value of x>1 will fullfil the ans*ans=1*1=1!=x, giving "x is not a perfect square". You basically needs to get your indentation right - like you do in your other example.
finding the number of perfect squares in the given range
Things are really simple here. Instead of looping from A to B and checking for perfect squares, we can calculate the first integer square root of A at O (1) and count the rest perfect squares with …
java - Perfect square if,else - Stack Overflow
Feb 2, 2013 · This is what he means by a perfect square: a perfect square like sqrt of 9=3 but false if the square root of that number is a decimal for example squareroot of 10 would be …
Check for number of perfect pairs in array - Stack Overflow
Dec 4, 2023 · After the transformation, each prime factor occurs no more than once in each number. Now notice that we only get perfect squares from products of identical numbers. For a …
Python Perfect Square - Stack Overflow
Jul 7, 2013 · I'm writing a function that takes a list L as a parameter and returns a list consisting of all the elements in L that are perfect squares. def isPerfectSquare(n): return …
Define a function to check if its a perfect square in C
Feb 28, 2021 · 1 I tried to write a code to check if a number is a perfect square, but I'm not able to call the function I defined. Where is my mistake?