Horje
Write a Python program to count total number of notes in given amount. Code Example
Write a Python program to count total number of notes in given amount.
x=[500,200,100,50,10,5,1]
y=int(input())
i=0
while y>0:
  if y>x[i]:
    count=y//x[i]
    print(y, "requires", count, "notes of", x[i] )
  y=y%x[i]
  i+=1
    
Write a Python program to count total number of notes in given amount.
m=int(input("Enter your payroll : "))
n=[5000,2000,1000,500,100,50,20,10,5,2,1]
t={}
for i in n:
    x=m//i
    t[i]=x
    m=m-i*x
print(t)
count the number of notes in a given amount c#
int  a[8]={500,100,50,20,10,5,2,1},m,temp,i; 
 
    printf("Enter the amount:");
 
    scanf("%d",&m);
    temp=m;
     for(i=0;i<8;i++)
    {
     printf("\n%d notes is:%d",a[i],temp/a[i]);
     temp=temp%a[i];




Python

Related
get all ForeignKey data by nesting in django Code Example get all ForeignKey data by nesting in django Code Example
#add,remove and clear all values on set in python Code Example #add,remove and clear all values on set in python Code Example
in deserialize_keras_object     raise ValueError('Unknown ' + printable_module_name + ':' + object_name) ValueError: Unknown loss function:contrastive_loss Code Example in deserialize_keras_object raise ValueError('Unknown ' + printable_module_name + ':' + object_name) ValueError: Unknown loss function:contrastive_loss Code Example
streamlit cheatsheet Code Example streamlit cheatsheet Code Example
shape Code Example shape Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
9