/* This the necklace number program it will start with the 2 number
that the user enter and will do the sum of the numbers till it gets
back to what the 2 starter number were.
Count = 1
Sum = 0
Have the user enter the first number
Have the user enter the second number
First = N1
Second = N2
Sum = first + second
Do {
Sum = (second + sum) %10
Count=+
Output the numbers
First = second
Second = sum
} while (sum =N2) & (second = N1)
Output count
28/10/10 By:Lelanie */
int main()
{
int Count = 1;
int sum = 0;
int Num1=0, Num2=0;
int first, second;
cout << "Enter the first number: ";
cin >> first;
cout << "Enter the second number: ";
cin >> second;
Num1 = first;
Num2 = second;
sum = first + second;
cout << first<<" "<<second<<" "<<sum<<" ";
do {
sum = (second + sum)%10;
Count++;
cout << sum << " ";
second = first;
sum = second;
}while ((sum != Num1) || (second != Num2));
cout << endl;
cout << "It took " << Count << " step to make the necklace.\n";
return 0;
}
okay normally this works but when i make it work it would. it goes though 1 loop then stops. i tried it with a or statement but i am wondering if there is anything that i am missing that i have not notice. if you can sread some light on what my problem is i will love that. and if you can't thank you anyway for trying.