- 1

C++ Enter money: 5252$ One thousand dollar: 5 One hundred dollar: 2 Fifty dollar:1 Ten dollar: 0 One dollar: 2 Please help :(

c++

9th Jul 2017, 3:16 PM
Melchor Gaspar Baltazar
Melchor Gaspar Baltazar - avatar
7 odpowiedzi
+ 2
#include<iostream> using namespace std; int main() { int n; int thous,hunds,fifs,tens,ones; cout<<"Enter Money:\t\n"; cin>>n; thous =n/1000; hunds =(n%1000)/100; fifs =((n%1000)%100)/50; tens =(((n%1000)%100)%50)/10; ones =((((n%1000)%100)%50)%10)/1; cout<<"Number Of One Thousand Dollars:"<<thous<<endl; cout<<"Number Of One Hundred Dollars:"<<hunds<<endl; cout<<"Number Of One Fifty Dollars:"<<fifs<<endl; cout<<"Number Of Tens Dollars:"<<tens<<endl; cout<<"Number Of One Dollars:"<<ones<<endl; return 0; }
9th Jul 2017, 4:04 PM
Rishabh Singh Rajput
Rishabh Singh Rajput - avatar
+ 1
where's the code is this your homework??
9th Jul 2017, 3:23 PM
‎ ‏‏‎Anonymous Guy
9th Jul 2017, 5:58 PM
‎ ‏‏‎Anonymous Guy
0
this is our midterm exam, i need to do it on c++ .
9th Jul 2017, 3:25 PM
Melchor Gaspar Baltazar
Melchor Gaspar Baltazar - avatar
0
if i enter 5252$ the output need to be like this: One thousand dollar: 5 One hundred dollar: 2 Fifty dollar:1 Ten dollar: 0 One dollar: 2
9th Jul 2017, 3:28 PM
Melchor Gaspar Baltazar
Melchor Gaspar Baltazar - avatar
0
thank u very much
9th Jul 2017, 5:33 PM
Melchor Gaspar Baltazar
Melchor Gaspar Baltazar - avatar
0
thank u very much sir!
9th Jul 2017, 5:36 PM
Melchor Gaspar Baltazar
Melchor Gaspar Baltazar - avatar