 # Denomination Program In C – Finding The 500, 100, 50, 20, 10, 5, 2, 1

Currency Denomination Program In C. Finding the number of 500, 100, 50, 20, 10, 5, 2, 1 rupees in entered amount. If you are looking for a C program to find denomination example, this C programming example will help you to learn how to write a program for currency denomination in C. Just go through this C programming tutorial to learn about finding the number of 500, 100, 50, 20, 10, 5, 2, 1 rupees.

## Denomination Program in C

• C Program to Display The Denominations of an Amount
• C Program For Denomination of an Amount Using While Loop – Source Code
• C Program to Read an Amount and Find Number of Notes – Output
• C Programming Tutorials

### C Program to Display The Denominations of an Amount

Learn how to write a  c Program to Display The Denominations of an Amount. Writing a currency denomination program in C can be done using various techniques but here in this program, we show how to write a c multiplication table program using while loop in a proper way. Happy coding.

### C Program For Denomination of an Amount Using While Loop – Source Code

You can copy paste the below C Program For Denomination of an Amount Using While Loop, in c compiler to check how the source code work. Or write your own currency denomination C Program with the help of this below c programming tutorial.

Source Code:

```/* C PROGRAM TO DISPLAY DENOMINATIONS OF AN AMOUNT - DENOMINATION.C */

#include<stdio.h>
#include<conio.h>
void main()
{
int rs, a, b, c, d, e, f, g, h ; //variable declaration
clrscr() ;
printf("Enter the amount in Rupees : ") ;
scanf("%d", &rs) ; //reding input from uer

//C Program Logic For Denomination of an Amount Using While Loop
while(rs >= 500)
{
a = rs / 500 ;
printf("\nThe no. of five hundreds are : %d", a) ;
break ;
}
while(rs >= 100)
{
b = rs / 100 ;
printf("\n\nThe no. of hundreds are : %d", b) ;
break ;
}
while(rs >= 50)
{
c = rs / 50 ;
printf("\n\nThe no. of fifties are : %d", c) ;
break ;
}
while(rs >= 20)
{
d = rs / 20 ;
printf("\n\nThe no. of twenties are : %d", d) ;
break ;
}
while(rs >= 10)
{
e = rs / 10 ;
printf("\n\nThe no. of tens are : %d", e) ;
break ;
}
while(rs >= 5)
{
f = rs / 5 ;
printf("\n\nThe no. of fives are : %d", f) ;
break ;
}
while(rs >= 2)
{
g = rs / 2 ;
printf("\n\nThe no. of Twos are : %d", g) ;
break ;
}
while(rs >= 1)
{
h = rs / 1 ;
printf("\n\nThe no. of ones are : %d", h) ;
break ;
}
getch() ;
}

```

#### C Program to Read an Amount and Find Number of Notes – OUTPUT

After you compile and run the above c program for currency denomination, your C compiler asks you to enter the amount to find the number of 500, 100, 50, 20, 10, 5, 2, 1 rupee notes. After you enter elements, the program will be executed and give output.

Output:

Enter the amount in Rupees : 179
The no. of hundreds are : 1
The no. of fifties are : 3
The no. of twenties are : 8
The no. of tens are : 17
The no. of fives are : 35
The no. of Twos are : 89
The no. of ones are : 179

### 4 thoughts on “Denomination Program In C – Finding The 500, 100, 50, 20, 10, 5, 2, 1”

1. better go in a simply way

2. why are you using while loops (when you immediately break them inside the loop)?
here’s a better way:

int i;
int dNomArr = {500, 100, 50, 20, 10, 5, 2, 1};

for (i = 0; i = dNomArr[i]) {
dNomCount = rs / dNomArr[i];
printf(“\n The number of %ds are: %d”, dNomArr[i], dNomCount);
}
}

3. * below the for statement:
if (rs >= dNomArr[i]) {

4. #include

int main ()
{

int dnum = {500,100,50,20,10,5,2,1};
int i,amount,dcount;

printf (“Enter amount: “);
scanf (“%d”, &amount);

for (i=0; i= dnum[i]){
dcount= amount / dnum[i];
printf (“\n The number of %d in the amount is: %d”, dnum[i], dcount);
}
};
}