Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main ()
- {
- double x;
- int y;
- cout << " Enter the quantitiy: " << endl;
- cin >> x;
- y= x*100;
- cout << " You will need (" << y/10000 << ") 100 dollar bills";
- cout << " (" << y/2000 << ") 20 dollar bills ";
- y=y%2000;
- cout << " (" << y/1000 << ") 10 dollar bills ";
- y=y%1000;
- cout << " (" << y/500 << ") 5 dollar bills ";
- y=y%500;
- cout << " (" << y/100 << ") 1 dollar bills ";
- y=y%100;
- cout << " and you will need " << y/25 << " Quaters " ;
- y=y%25;
- cout << " (" << y/10 << ") Dimes " ;
- y=y%10;
- cout << " (" << y/5 << ") Nickels " ;
- y=y%5;
- cout << " (" << y/1 << ") Pennies " ;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement