Given two numbers a and b and the task is to check whether the concatenation of a and b is a perfect square or not.
Input: a = 1, b = 21
121 = 11 × 11, is a perfect square.
Input: a = 100, b = 100
100100 is not a perfect square.
Approach: Initialize the number as strings initially and concatenate them. Convert the string to a number using Integer.valueOf() function. Once the string has been converted to a number, check if the number is a perfect square or not.
Below is the implementation of the above approach.
- Check whether a binary string can be formed by concatenating given N numbers sequentially
- Check if given number is perfect square
- Permutation of numbers such that sum of two consecutive numbers is a perfect square
- Check perfect square using addition/subtraction
- 8086 program to find the square root of a perfect square root number | Set-2
- Largest number that is not a perfect square
- Find minimum number to be divided to make a number a perfect square
- Largest factor of a given number which is a perfect square
- Find the Next perfect square greater than a given number
- Minimum digits to remove to make a number Perfect Square
- Program to check Plus Perfect Number
- Number of perfect squares between two given numbers
- Check if the large number formed is divisible by 41 or not
- PHP | Check if a number is Perfect number
- Perfect Square String
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.