I have no idea how to do this in C++, but in C#, I'd do something similar:
Code:
Console.WriteLine("Enter a number: "); //Tells the user to enter a value
int summa = int.Parse(Console.ReadLine()); //Read the int with ReadLine(), had to do it like this, string wont work
while (summa > 100)
{
summa = summa - 100; //subtract summa with 100 each time it's > 100
}
Console.WriteLine(summa); //Write the value of summa when it's < 100
You can probably port this to C++ easily.
EDIT: Example:
Originally Posted by My program output
Enter a number:
891
91
Press any key to continue . . .
EDIT2: Hope I did understand everything right. And to any other C# programmer, this is probably a bad way to do it, just like everything else I program. Live with it - it works.