Ans 15. A cashier has currency notes of denominations 10, 50 and 100. If the amount to be withdrawn is input through the keyboard, WAP to find the total number of currency notes of each denomination the cashier will have to give to the withdrawer. 1
#include<stdio.h>
int main()
{
int amt, h=0, f=0, t=0 ;
printf("Enter amount to withdraw:");
scanf("%d",&amt);
if(amt>=100)
{
h=amt/100;
amt=amt%100;
}
if(amt>=50)
{
f=amt/50;
amt=amt%50;
}
if(amt>=10)
{
t=amt/10;
amt=amt%10;
}
printf("Currency notes of each denomination is:\n");
printf("Rs 100 notes are: %d\n", h);
printf("Rs 50 notes are: %d\n", f);
printf("Rs 10 notes are: %d\n", t);
return 0;
}