[46965 views]

A number is said to be a perfect square when the number is generated by multiplying two equal integers by each other. A perfect square can never be a negative integer because even if we multiply two negative integers, the product will always be positive.

For example: 1, 4, 9, 16, 25, 36, 121, 144, etc.

Let us take a look at the algorithm and flowchart to have a better understanding.

The algorithm starts off by taking the number to be checked as user input. After that, we will check whether the number is greater than or equal to 0 or not, because a perfect square can never be a negative integer. If the number is positive, we will start a loop from zero to that number. For each value of the loop variable, we will check whether the square of that number and the given number are equal or not. If they are equal, the given number is a perfect square. So, the program will terminate here.

If the condition does not satisfy for any value of the loop variable, this means that the given number is not a perfect square.

- Java IDE Online
- Python IDE Online
- JSON Formatter/Minifier Online
- Case Converter
- Reverse String
- HTML Encoder
- HTML Decoder
- URL Encoder
- URL Decoder
- Decimal To Binary
- Binary To Decimal
- Decimal To Octal
- Binary To Octal
- Decimal To Hexadecimal
- Hexadecimal To Decimal
- Hexadecimal To Binary
- Octal To Decimal
- Octal to Hexadecimal
- Octal to Binary
- Calculate String Length
- Remove Spaces
- Remove Line Breaks
- Remove Empty Lines
- Remove Duplicate Lines
- Word Counter
- Replace Space with hyphen
- Check Armstrong number
- Text to URL