TOPIC

could some one help me get the error , discovered.

amamdouh10 asked 6 years ago

include

using namespace std;

int main() { int A,S,D,F,G,H,J,K,L,Z,X,C; double N; cin>>N;

A=N/100; N=N-(A*100);

S=N/50; N=N-(S*50);

D=N/20; N=N-(D*20);

F=N/10; N=N-(F*10);

G=N/5; N=N-(G*5);

H=N/2; N=N-(H*2);

J=N/1; N=N-(J*1);

K=N/.50; N=N-(K*.50);

L=N/.25; N=N-(L*.25);

Z=N/.1; N=N-(Z*.1);

X=N/.05; N=N-(X*.05);

C=N/.01; N=N-(C*.01);

cout<<"NOTAS:"<<endl; cout<<A<<" nota(s) de R$ 100.00"<<endl; cout<<S<<" nota(s) de R$ 50.00"<<endl; cout<<D<<" nota(s) de R$ 20.00"<<endl; cout<<F<<" nota(s) de R$ 10.00"<<endl; cout<<G<<" nota(s) de R$ 5.00"<<endl; cout<<H<<" nota(s) de R$ 2.00"<<endl; cout<<"MOEDAS:"<<endl; cout<<J<<" moeda(s) de R$ 1.00"<<endl; cout<<K<<" moeda(s) de R$ .50"<<endl; cout<<L<<" moeda(s) de R$ .25"<<endl; cout<<Z<<" moeda(s) de R$ .10"<<endl; cout<<X<<" moeda(s) de R$ .05"<<endl; cout<<C<<" moeda(s) de R$ .01"<<endl;

}

Remember not post solutions. Your post may be reviewed by our moderators.

  • imam_mahadi0 replied 5 years ago

    Try simple if-else statement buddy............