I am not going to rewrite this for you but I think it would be easier for you to think in terms of cents as the 'whole' number. What this means is you should accept the input of the amount in dollars with cents as the fractional part as you do now. Then you should make another variable that is an integer and it is the input value times 100. For example, if you enter 123.45 then this new variable will hold 12345. The do all of your calculations using this variable and it will be all integer math.
The reasoning behind this is cents are essentially a whole number. With money, there can be no smaller value so use it as the base unit. One hundred dollars is 10000 cents, ten dollars is 1000 cents, and one dollar is 100 cents. After that, the coin denominations are whole values. This will simplify things a lot and should be easier for you to deal with. The first section of your code should change very little - just multiply the divisors by 100. The last part will also scale the divisors by 100 but it should be changed to use integer math.
One tip I will give is about how you compute your values. Here is one excerpt :
iMoney50 = iMoney_back / 50;
iMoney_back = (int)iMoney_back % 50;
You can make this a function to simplify things. The key is to pass the amount of money in as a reference since it will be modified in the function. Here is that code :
int GetTypeAmount( int & money, int denomination )
{
int count = money / denomination;
money %= denomination;
return count;
}
This will return the number of that denomination of money. Here is a sequence of calls to it :
int count = 0;
int money = 12345;
count = GetTypeAmount( money, 10000 );
cout << "You will get: " << count << " X 100.00 $" << endl;
count = GetTypeAmount( money, 5000 );
cout << "You will get: " << count << " X 50.00 $" << endl;
count = GetTypeAmount( money, 2000 );
cout << "You will get: " << count << " X 20.00 $" << endl;
count = GetTypeAmount( money, 1000 );
cout << "You will get: " << count << " X 10.00 $" << endl;
count = GetTypeAmount( money, 500 );
cout << "You will get: " << count << " X 5.00 $" << endl;
count = GetTypeAmount( money, 100 );
cout << "You will get: " << count << " X 1.00 $" << endl;
count = GetTypeAmount( money, 25 );
cout << "You will get: " << count << " X 0.25 $" << endl;
count = GetTypeAmount( money, 10 );
cout << "You will get: " << count << " X 0.10 $" << endl;
count = GetTypeAmount( money, 5 );
cout << "You will get: " << count << " X 0.05 $" << endl;
count = money;
cout << "You will get: " << count << " X 0.01 $" << endl;
You could take this one step farther and include the output in the function but I will leave that for you to figure out.