C++ programing

I need to write a program that asks the user for two starting numbres,
and then display the sequence and the number of step of taken. the program
output should look similar to the following:

Enter first number:1
Enter second number: 8

the numbers requiered 12 steps.
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

glennysgConnect With a Mentor Commented:
Hi Arnond, how you doing? Thanks for help me.
I want to give you your grade but I don't konw how to do it.
I'm teaching myselft with c++ because I have to take it next semeter, but I think it is too hard for me. But anyway I want to try it.
Please tell me how can I give you your grade por help me.

What are the steps?
The rule seems to be that two consecutive numbers are added and the least significant digit of the sum is then used as the next digit in the output.

1 + 8 = 9
8 + 9 = (1)7
9 + 7 = (1)6
7 + 6 = (1)3 etc.

The process seems to stop when the new digit is the same as the second number entered at start. Am I right?

Ciao, Mike
you can use the same principle as in your other question. use the % (ex.: 7453%10=3) operator to find the least segnificant digit of the resault of the additions and then compare it to what ever you need to compare it to.

tell me if you need more help,
Arnon David.
you should login as  "glennys" and reject the answer you've posted as "glennysg" and then ask me to post an asnwer for this question or, if you can, click on "accept comment" in my comment (if it's available).

Arnon David.

p.s., don't give up. learning a new programming language is a hard thing and only by doing exersices and experiments you can learn.
All Courses

From novice to tech pro — start learning today.