program to evaluate number of currency note
program to evaluate number of currency note
#include<stdio.h>void main()
{
int num,a=2000,b=500,c=100,d=50,e=20,f=10,g=5,h=2,z=1,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y;
printf("enter amount\n");
scanf("%d",&num);
i=num/a;
printf("no. of 2000 note is :%d\n",i);
j=num%a;
k=j/b;
printf("no. of 500 note is :%d\n",k);
l=j%b;
m=l/c;
printf("no. of 100 note is :%d\n",m);
n=l%c;
o=n/d;
printf("no. of 50 note is :%d\n",o);
p=n%d;
q=p/e;
printf("no. of 20 note is :%d\n",q);
r=p%e;
s=r/f;
printf("no. of 10 note is :%d\n",s);
t=r%f;
u=t/g;
printf("no. of 5 note is :%d\n",u);
v=t%g;
w=v/h;
printf("no. of 2 note is :%d\n",w);
x=v%h;
y=x/z;
printf("no. of 1 note is :%d/n",z);
}
out put:-
No comments: