A Cashier has a currency notes of denomination 10,50 and 100. If the amount to be withdrawn is input through the keyboard in maximum hundreds, find the total number of currency notes of each denomination the cashier will have to give to the withdrawer
1275
Hundred rs note=12
50 rs note=1
10 rs note=2
remaining=5
class Hundreds
{
public static void main(String args[])
{
int amount=1275;
System.out.println(“Required notes of 100=”+(amt/100));1275/100=>12
System.out.println(“Required notes of 50=”+(amt%100)/50);1275%100=>75
//75/50=>1
System.out.println(“Required notes of 10=”+((amt%100)%50)/10);
1275%100=>75%50=>25/10=2
System.out.println(“Required amount=”+((amt%100)%50)%10);
1275%100=>75%50=>25%10=>5
}
}
12345%10==>5
12345%100==>45
12345%1000==>345
12345/10==>1234
12345/100==>123