I wrote this program using a C programming language that will ask the user an amount in the Philippines Peso currency and then the program will count the number of bill denominators in the given amount from our user.
My email address is the following jakerpomperada@gmail.com, jakerpomperada@aol.com, and jakerpomperada@yahoo.com.
My mobile number here in the Philippines is 09173084360.
My telephone number at home here in Bacolod City, Negros Occidental Philippines is +63 (034) 4335675.
Here in Bacolod City, Negros Occidental I also accepting computer repair, networking and Arduino Project development at a very affordable price.
My Facebook address is https://www.facebook.com/profile.php?...
My personal website is http://www.jakerpomperada.com
My programming website is http://www.jakerpomperada.blogspot.com
I am also a book author you can purchase my books on computer programming and information technology in the following links below.
https://www.mindshaperspublishing.com/
https://www.unlimitedbooksph.com/
Thank you very much for your help and support.
Sample Program Output
Program Listing
money.c
/* money.c
Jake R. Pomperada,MAED-IT
November 17, 2019
Bacolod City, Negros Occidental
*/
#include <stdio.h>
int main()
{
int amount=0;
int note1000=0,note500=0, note100=0, note50=0, note20=0, note10=0, note5=0, note2=0, note1=0;
note1000=note500 = note100 = note50 = note20 = note10 = note5 = note2 = note1 = 0;
printf("\n\n");
printf("\tMoney Denominator in C");
printf("\n\n");
printf("\tGive an Amount PHP : ");
scanf("%d", &amount);
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)
{
note5 = amount/5;
amount -= note5 * 5;
}
if(amount >= 2)
{
note2 = amount /2;
amount -= note2 * 2;
}
if(amount >= 1)
{
note1 = amount;
}
printf("\n\n");
printf("\tTotal number of notes = \n");
printf("\n");
printf("\t1000 = %d\n", note1000);
printf("\t500 = %d\n", note500);
printf("\t100 = %d\n", note100);
printf("\t50 = %d\n", note50);
printf("\t20 = %d\n", note20);
printf("\t10 = %d\n", note10);
printf("\t5 = %d\n", note5);
printf("\t2 = %d\n", note2);
printf("\t1 = %d\n", note1);
printf("\n\n");
printf("\tEnd of Program");
}
No comments:
Post a Comment