C Program to A cashier has currency notes of denominations 10, 50 and 100 - IProgramX

Q. C Program - A cashier has currency notes of denomination 1, 5 and 10 . Accept the amount to be withdrawn from the user and print the total number of currency notes of each denomination the cashier will have to give


Program

#include<stdio.h>
int main()
{
int w,x,y,z;
printf("enter withdrow amount : ");
scanf("%d",&w);
x=w/10;
w=w%10;
y=w/5;
w=w%5;
z=w;
printf("note of 10 : %d\n",x);
printf("note of  5 : %d\n",y);
printf("note of  1 : %d\n",z);
}

Output:

enter withdrow amount : 564
note of 10 : 56
note of  5 : 0
note of  1 : 4

Post a Comment

0 Comments