Skip to main content

Posts

Showing posts with the label 8. Write a Java program to count total number of notes in given amount.

ads1

8. Write a Java program to count total number of notes in given amount.

  8.Write a Java program to count total number of notes in given amount. Static   Solution  :- class notes {     public static void main(String args[])     {     int amount =1007;         int note2000, note500,note200,note100,note50,note20,note10,note5,note2,note1;         note2000=note500=note200=note100=note50=note20=note10=note5=note2=note1=0;         if (amount >=2000)     {         note2000 = amount/2000;         amount = amount - note2000 * 2000;     }     if (amount >=500)     {         note500 = amount/500;         amount = amount - note500 * 500;     }         if (amount >=200)  ...

ads2