Friday, August 29, 2014

A cashier has currency notes of denominations 10, 50 and 100. If the amount to be withdrawn is input through the keyboard in hundreds, find the total number of currency notes of each denomination the cashier will have to give to the with-drawer


Code

#include<stdio.h>
int main()
{
float t,t1,t2,t3;
int m1,m2,m3;

printf("\nInput notes in hundreds");
scanf("%f",&t);
t3=t/100;
m3=t3;

t2=(t-m3*100.0)/50;
m2=t2;

t1=(t-(m3*100.0+m2*50.0))/10;
m1=t1;

printf("\n\nThe no of 100 notes is %d\nThe no of 50 notes is %d\nThe no of 10 notes is %d",m3,m2,m1);

printf ("\n\nPress any key to close.");
getch ();
return 0;
}

Output

cash handling c language

1 comment :

Note: Only a member of this blog may post a comment.

Copyright 2017. All Rights Reserved. Privacy Policy / Terms And Conditions / Sitemap / Contact