#include "stdio.h"
#include "conio.h"
void main()
{
float Price;
float Bank;
int change;
int Total;
printf("Price:");
scanf("%f",&Price);
printf("Bank:");
scanf("%f",&Bank);
Price=Price *100;
Bank=Bank *100;
change = Bank - Price;
Total = change / 100000;
printf("1,000 = %d\n",Total);
change = change % 100000;
Total = change / 50000;
printf("500 Bill = %d\n",Total);
change = change % 50000;
Total = change / 10000;
printf("100 Bill = %d\n",Total);
change = change % 10000;
Total = change / 5000;
printf("50 Bill = %d\n",Total);
change = change % 5000;
Total = change / 2000;
printf("20 Bill = %d\n",Total);
change = change % 2000;
Total = change / 1000;
printf("10 Coin = %d\n",Total);
change = change % 1000;
Total = change / 500;
printf("5 Coin = %d\n",Total);
change = change % 500;
Total = change / 100;
printf("1 Coin :%d\n",Total);
change = change % 100;
Total = change / 50;
printf("0.5 Coin :%d\n",Total);
change = change % 50;
Total = change / 25;
printf("0.25 Coin :%d\n",Total);
change = change % 25;
}
Be the first to comment
You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.