Code:
#include<stdio.h>
#include<conio.h>
int main()
{
long amount;
long note5000, note1000, note500, note100, note50, note20, note10, coin5, coin2, coin1;
clrscr();
note5000 = note1000 = note500 = note100 = note50 = note20 = note10 = coin5 = coin2 = coin1 = 0;
printf("Enter the amount: ");
scanf("%ld", &amount);
if(amount >= 5000)
{
note5000 = amount/5000;
amount -= note5000 * 5000;
}
if(amount >= 1000)
{
note1000 = amount/1000;
amount -= note1000 * 1000;
}
if(amount >= 500)
{
note500 = amount/500;
amount -= note500 * 500;
}
if(amount >= 100)
{
note100 = amount/100;
amount -= note100 * 100;
}
if(amount >= 50)
{
note50 = amount/50;
amount -= note50 * 50;
}
if(amount >= 20)
{
note20 = amount/20;
amount -= note20 * 20;
}
if(amount >= 10)
{
note10 = amount/10;
amount -= note10 * 10;
}
if(amount >= 5)
{
coin5 = amount/5;
amount -=coin5 * 5;
}
if(amount >= 2)
{
coin2 = amount/2;
amount -=coin2 * 2;
}
if(amount >= 1)
{
coin1 = amount;
}
printf("Total number of notes = \n");
textcolor(GREEN);
cprintf("5000 = %ld\n", note5000);
textcolor(MAGENTA);
cprintf("1000 = %ld\n", note1000);
textcolor(MAGENTA);
cprintf("500 = %ld\n", note500);
textcolor(MAGENTA);
cprintf("100 = %ld\n", note100);
textcolor(MAGENTA);
cprintf("50 = %ld\n", note50);
textcolor(MAGENTA);
cprintf("20 = %ld\n", note20);
textcolor(MAGENTA);
cprintf("10 = %ld\n", note10);
textcolor(MAGENTA);
cprintf("5 = %ld\n", coin5);
textcolor(MAGENTA);
cprintf("2 = %ld\n", coin2);
textcolor(MAGENTA);
cprintf("1 = %ld\n", coin1);
getch();
return 0;
}
Above is my code,I want this program to ask amount and then check the amount and ask in which denominations the money is required depending on the amount and I want to add font style please help me.