Program to print all Kaprekar numbers between 1 to 100A non-negative integer having base(10) is said to be the Kaprekar number if the representation of its square in its base can be split into two parts that add up to the original number, with the condition that the part formed from the low-order digits of the square must be non-zero-however, it is allowed to include leading zeroes. Examples: 45 = (45)2 = 2025 =20 + 25 -45 1 = 12 = 01 = 0 + 1 = 1 Algorithmmain()
Kaprekar(int n)
Java ProgramOutput: 9 10 45 55 99 Python ProgramOutput: 9 10 45 55 99 C ProgramOutput: 9 10 45 55 99 C# Program:Output: 9 10 45 55 99 PHP programOutput: 9 10 45 55 99 Next Topic# |
We provides tutorials and interview questions of all technology like java tutorial, android, java frameworks
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India