consider A currency system in which there are notes of seven denominations namely Rs.1,Rs.2,Rs.5,Rs.10,Rs.50,Rs.100.If a sum of Rs. N is the entired through the keyboard ,Write a program to compute the smallest number of notes that will combine to give Rs.N.
consider A currency system in which there are notes of seven denominations namely Rs.1,Rs.2,Rs.5,Rs.10,Rs.50,Rs.100.If a sum of Rs. N is the entered through the keyboard ,Write a program to compute the smallest number of notes that will combine to give Rs.N
program----
#include<stdio.h>
int main ()
{
int amount,nohun,nofifty,noten,nofive, notwo,noone,total;
printf("Enter the amount:");
scanf("%d",&amount);
nohund=amount/100;
amount=amount%100;
nofifty=amount/50;
amount=amount%50;
noten=amount/50;
amount=amount%10;
nofive=amount/5;
amount=amount%5;
notwo=amount/2;
amount=amount%2;
noone=amount/1;
amount=amount%1;
total=nohund+nofifty+noten+nofive+notwo+noone:
printf("Smallest number of notes=%d\n",total);
return 0;
}
OUTPUT ---
Enter the amount: 4505
Smallest number of notes= 46
OUTPUT ---
If a five digit number is input through the keyboard write a program to the reverse the number--
click the link--
https://www.blogger.com/u/2/blog/post/edit/5851128460296589847/4124566085027503499
paper of size A0 has dimensions 1189 mm X 841 mm .Each subsequent size A(n) is defined as A(n-1) cut in half parallel to its shorter sides .Thus paper of size A1 would have dimensions 841 mm X 594 mm .Write a program to calculate the print paper sizes A0,A1,A2,.........A8
click the link--
https://allcodescience.blogspot.com/2021/12/paper-of-size-a0-has-dimensions-1189.html
https://allcodescience.blogspot.com/2021/12/the-length-and-breadth-of-rectangle-and.html
Comments
Post a Comment