-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRs-notes.c
More file actions
40 lines (30 loc) · 901 Bytes
/
Copy pathRs-notes.c
File metadata and controls
40 lines (30 loc) · 901 Bytes
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
#include<stdio.h>
// write a program to break entered money amount into 2000 , 500 , 100 ... rupee notes.
int main()
{
int total , amt ;
printf("enter amount : Rs ");// enter amount .
scanf("%d",&amt);
// every time total will change
total = amt / 2000 ;
amt = amt - (total * 2000);
printf("\n2000 note : %d",total);
total = amt / 500 ;
amt = amt - (total * 500 );
printf("\n500 note : %d",total);
total = amt / 100 ;
amt = amt - (total * 100 );
printf("\n100 note : %d",total);
total = amt / 50 ;
amt = amt - (total * 50 );
printf("\n50 note : %d",total);
total = amt / 20 ;
amt = amt - (total * 20 );
printf("\n20 note : %d",total);
total = amt / 10 ;
amt = amt - (total * 10 );
printf("\n10 note : %d",total);
total = amt / 1 ;
amt = amt - (total * 1 );
printf("\n1 note : %d",total);
}