-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmoneycash.c
41 lines (32 loc) · 1.19 KB
/
moneycash.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#include<stdio.h>
int main()
{
int cash,b,r;
printf("please enter the amount of cash u have");
scanf("%d",&cash);
b=cash;
int n2000=cash/2000;
cash=cash-n2000*2000;
int n500=cash/500;
cash=cash-n500*500;
int n200=cash/200;
cash=cash-n200*200;
int n100=cash/100;
cash=cash-n100*100;
int n50=cash/50;
cash=cash-n50*50;
int n20=cash/20;
cash=cash-n20*20;
int n10=cash/10;
cash=cash-n10*10;
printf("%d notes of 2000 required\n",n2000);
printf("%d notes of 500 required\n",n500);
printf("%d notes of 200 required\n",n200);
printf("%d notes of 100 required\n",n100);
printf("%d notes of 50 required\n",n50);
printf("%d notes of 20 required\n",n20);
printf("%d notes of 10 required\n",n10);
int total=n2000+n500+n200+n100+n50+n20+n10;
printf("\n\ntotal no. of notes = %d",total);
return 0;
}