Skip to main content

Posts

Showing posts with the label curency denomination

CURRENCY DENOMINATION

PROGRAM: CURRENCY DENOMINATION The Objective is to get currency in sorted manner ie. if user have 5412 Rs then the output might be 2 X 2000 = 4000 1 X 1000 = 1000 4 X 100  = 400 1 X 10   = 10 1 X 2    = 2 __________________ TOTAL:  5412 SYNTAX import java.io.*; class currency_denom { static int a[]={2000,1000,500,100,50,20,10,5,2};static int x=0;     public static void main(String args[])throws IOException     {         BufferedReader br=new BufferedReader(new InputStreamReader(System.in));         System.out.println("Enter Amount");         int n=Integer.parseInt(br.readLine());System.out.println("DENOMINATED CURRENCY:");         int tot=n;         den(n,a[x]);         System.out.println("____________________\nTOTAL: "+tot);     }     public static void den(int...