home *** CD-ROM | disk | FTP | other *** search
/ C by Discovery (4th Edition) / C_By_Discovery_4th_Edition.tar / C_By_Discovery_4th_Edition / _DISK_ / ch2 / epp10.c < prev    next >
C/C++ Source or Header  |  2005-06-16  |  734b  |  31 lines

  1. /*             epp10.c               */
  2.  
  3. /* Include Files */
  4. #include <stdio.h>
  5.  
  6. /* Function Prototypes */
  7. void printmoney( int money );
  8. /*   PRECONDITION:  money is any integer. It represents
  9.  *                    a number of pennies.
  10.  *
  11.  *   POSTCONDITION: The value of money is been displayed
  12.  *                  on standard output with a $ preceding
  13.  *                  the number and a decimal point before
  14.  *                  the last two digits.
  15.  */
  16.  
  17. int main( void )
  18. {
  19.      printmoney( 12 );
  20.      printf( "\n" );
  21.      printmoney( 1000 );
  22.      printf( "\n" );
  23.      printmoney( 25304 );
  24.      printf( "\n" );
  25.      printmoney( 0 );
  26.      printf( "\n" );
  27.      printmoney( 145 );
  28.      printf( "\n" );
  29.      return 0;
  30. }
  31.