- 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++
7 Réponses
+ 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;
}
+ 1
where's the code
is this your homework??
0
this is our midterm exam, i need to do it on c++ .
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
0
thank u very much
0
thank u very much sir!