Author Topic: Java Kaprekar Transformation 3 Digit Number ends with 495  (Read 836 times)

kathir

  • Administrator
  • Sr. Member
  • *****
  • Posts: 283
Java Kaprekar Transformation 3 Digit Number ends with 495
« on: November 14, 2011, 03:28:50 pm »
I have given here Java code for Kaprekar Transformation for a 3 digit number. The logic is as follows:
 
1. Make sure the given number is 3 digits.
2. Make sure all the digits are not same.
3. With the given number, form two numbers with descending and ascending 3 digits.
4. Subtract the small number from the big number.
5. Take the difference as a new number and repeat step 3 until you reach 495.

Source code can be found at http://www.softwareandfinance.com/Java/Kaprekar_transformation_3digit_number.html



 


Disclaimer: This web site is for educational and informational purposes only. Click here to read the Disclaimer.
Content copyright 2010-2014. Kathiresan. All rights reserved.
This page is using SMF version 2.0.1