Its an exact change program but the output is not right. I don't know whats wrong in it. Can somebody please help me with program.
#include <iostream>
using namespace std;
int main ()
{
int twenties, tens, fives, singles, quarters, dimes, nickles, pennies;
double purchase, pay, rempay=0;
cout<< "please enter the purchase amount ";
cin>> purchase;
cout<< " please enter the payment amount ";
cin>> pay;
rempay = pay - purchase;
twenties = int(rempay/20);
rempay= rempay - 20;
tens= int(rempay/10);
rempay = rempay - 10;
fives= int(rempay/5);
rempay= rempay - 5;
singles = int(rempay / 1);
rempay = rempay - 1;
quarters = int(rempay / .25);
rempay = rempay - .25;
dimes = int(rempay / .10);
rempay = rempay - .10;
nickles = int(rempay / .05);
rempay= rempay - .05;
pennies= int(rempay / .01);
cout<< "twenties - " << twenties << '\n';
cout << "tens - " << tens << '\n';
cout <<" fives - " << fives << '\n';
cout << "singles - " << singles << '\n';
cout << "Quarters - " << quarters << '\n';
cout << "Dimes - " << dimes << '\n';
cout << "Nickels - " << nickles << '\n';
cout << "Pennies - " << pennies << '\n';
return 0;
}