Runtime error

Mumtaheena101 asked 4 months ago

I did the following code. It runs on other compiler but shows runtime error here. Can anyone help?


int main() { int a, h, f, t, d, p, w, o; scanf("%d", &a);

h = a/100;

f = ((a-(h*100)))/50;

t = (a-(h*100+f*50))/20;

d = (a-(h*100+f*50+t*20))/10;

p = (a-(h*100+f*50+t*20+d*10))/5;

w = (a-(h*100+f*50+t*20+d*10+p*5))/2;

o = (a-(h*100+f*50+t*20+d*10+p*5+w*2))/1;

printf("%d nota(s) de R$ 100,00\n%d nota(s) de R$ 50,00\n%d nota(s) de R$ 20,00\n%d nota(s) de R$ 10,00\n%d nota(s) de R$ 5,00\n%d nota(s) de R$ 2,00\n%d nota(s) de R$ 1,00\n", h, f, t, d, p, w, o);


This topic has not been answered yet. Be the first!

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