title: C programming - Breaking down of money
body: <p>I need to break down the amounts on their respective bill/coin.</p>
  
  <p>The output is somewhat like this:</p>
  
  <p>So far, here is my code: (I made the last few codes a comment one 'cos the 
  errors come from there)</p>
  
  <pre><code>  { 
    int x,y;
  
    printf("Enter input: ");
    scanf("%d",&amp;x);
  
    y=x/1000;
    printf("\n# of $1000 bill: %d",y);
    x = x%1000;
  
    y=x/500;      
    printf("\n# of 4500 bill: %d",y);    
    x = (x%500);
  
    y=x/200;
    printf("\n#. of $200 bill: %d",y);    
    x = (x%200);
  
    y=x/100;
    printf("\n# of $100 bill: %d",y);    
    x = (x%100);
  
    y=x/50;
    printf("\n# of $50 bill: %d",y);    
    x = (x%50);
  
    y=x/20;
    printf("\n# of $20 bill: %d",y);    
    x = (x%20);
  
    y=x/10;
    printf("\n#. of $10 coin: %d",y);    
    x = (x%10);
  
    y=x/5;
    printf("\n#. of $5 coin: %d",y);    
    x = (x%5);
  
    y=x/1;
    printf("\n# of $1 coin: %d",y);    
    x = (x%1);
  
  
    getch();
    return 0;
    }
  </code></pre>
  
  <p>I hope you'll help me out with this. :/ </p>
  
  <p>Thanks!</p>