This problem begins with two single-digit numbers. The next number is obtained by adding the first two numbers together and saving only the ones-column-digit.This process is repeated until the “necklace” closes by returning to the original two numbers. For example, if the starting numbers are 1 and 8, twelve steps are required to close the “necklace”:
1 8 9 7 6 3 9 2 1 3 4 7 1 8
I need a program that will ask for the user two input 2 numbers ( firstNumber and secondNumber)
Then the program will show the number of steps until the last 2 numbers are the same.
For example:
Enter the first number: 1
Enter the second number: 8
1 8 9 7 6 3 9 2 1 3 4 7 1 8
Your number required 12 steps.
Bookmarks