Computer problems,Computer help
*AX SOFT>>>Programming & Design

C programming Probelem..Money changer?


hi everyone, how can I make a money changer program? like, if the user inputed 100 pesos and you want it to change by two 50 pesos...another example: if the user inputed 1000 pesos and you want it to change by one 500 pesos and five 100pesos. my program should be in .C file extension
hope you will help me.. thanks in advance!
(by the way pesos is the currency in Philippines)

You currently have the following currency.
Peso Notes
5
10
20
50
100
200
500
1000

centavos
1
5
10
25

Take the input and divide it in turn by each amount starting with the highest note.
The integer from the division is the number of that item that you want for change. The remainder becomes the new input value.
Stop when the input is zero.

It should be noted that the remainder from dividing 5 centavos will be the result for 1 centavos so you do not have to do this final divide. However it may be easier to code the divide to keep the program simple.

Tags
  General - Computers & Internet   Software   Security   Programming & Design   Facebook   Flickr   Google   MSN   MySpace
Related information
  • How to program to copy the content from a word file to a .html file and keep the original format?

    u need to know the format of word file to do that (.doc file format) .html file is a pure text file, hence no prob creating it. U have to read the .doc file and process it to create a .html f...

  • Where is the best place to get free table quiz quistions????

    If this is homework, your textbook. If it's for a qualifying exam, a textbook for that exam.

    ...
  • Problems with website building?

    Dear... > You Can Use The Web View Buttone On Bottom Left Area, And See how IT Will Be After Saveing As Web. > You Don't Have To Use Ms-Word To Build A website, You Can Use Frontpage, ...

  • Creating tables in sql?

    CREATE TABLE `person` ( `id` INT NOT NULL AUTO_INCREMENT , `name` VARCHAR( 64 ) NOT NULL , `age` INT( 8 ) NOT NULL , UNIQUE ( `id` ) ) ENGINE = innodb; Simple example that works for me.

  • Ftp swf html question. First time uploading into server.?

    You can edit the .htaccess file placed in your wwwroot directory and add the line: DirectoryIndex index.html index.htm index.php Using this line you can specify (the order in) which documents...

  • I need a script that can verify if a link is on a certain page. Please read all details before answering, Thx!

    getElementsByTagName('a') will return an array of all anchor elements in the page. Compare the href attributes of those items to the requested url until you find a match or fail. <h...

  • How can market knowledge be improved for GlaxoSmithKline using the internt or the WWW??

    You're lucky girl coz i answer you : Use this .. ...

  • How to Write a SQL statement to display the repeated rows of the table below:?

    Ok, I will assume that 'topic_id' is the criteria for determining if the row is repeated (i.e. topic_id is the same on two or more items). I am giving you a generic way of dealing wit...

  •  

    Categories--Copyright/IP Policy--Contact Webmaster