home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload / ShartewareOverload.cdr / progm / ctutor2.zip / ANSWERS / CH05_3.C < prev    next >
Text File  |  1989-11-10  |  738b  |  43 lines

  1. #include "stdio.h"       /* Prototypes for Input/Output  */
  2. void count_dn(int count);
  3.  
  4. main()
  5. {
  6. int index;
  7.  
  8.    index = 8;
  9.    count_dn(index);
  10. }
  11.  
  12. void count_dn(int count)
  13. {
  14.    count--;
  15.    printf("The value of the count is %d\n",count);
  16.    if (count > 0)
  17.       count_dn(count);
  18.    printf("Now the count is %d\n",count);
  19. }
  20.  
  21.  
  22.  
  23. /* Result of execution
  24.  
  25. The value of count is 7
  26. The value of count is 6
  27. The value of count is 5
  28. The value of count is 4
  29. The value of count is 3
  30. The value of count is 2
  31. The value of count is 1
  32. The value of count is 0
  33. Now the count is 0
  34. Now the count is 1
  35. Now the count is 2
  36. Now the count is 3
  37. Now the count is 4
  38. Now the count is 5
  39. Now the count is 6
  40. Now the count is 7
  41.  
  42. */
  43.