number based program

Capricorn or Kaprekar Number Program in Java

A number is called Capricorn or Kaprekar number whose square is divided into two parts in any conditions and parts are added, the additions of parts is equal to the number, is called Capricorn or Kaprekar number.

Example: 45

45 =  (45)2 = 2025

2025
All parts for 2025:-
202 + 5 = 207 (not 45)
20 + 25 = 45
2 + 025 = 27 (not 45)

Above we can see one combination is equal to number so that 45 is Capricorn or Kaprekar number.