home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / lang / c / 17088 < prev    next >
Encoding:
Internet Message Format  |  1992-11-24  |  964 b 

  1. Path: sparky!uunet!munnari.oz.au!goanna!ok
  2. From: ok@goanna.cs.rmit.oz.au (Richard A. O'Keefe)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: confused
  5. Message-ID: <16055@goanna.cs.rmit.oz.au>
  6. Date: 24 Nov 92 04:00:46 GMT
  7. References: <1elj18INNnah@uwm.edu>
  8. Organization: Comp Sci, RMIT, Melbourne, Australia
  9. Lines: 23
  10.  
  11. > #include <stdio.h>
  12. > main()
  13. > {
  14. > float answr;
  15. > int fact;
  16. > int count;
  17. > printf ("This program is designed to print the factoral of a number ");
  18. > printf ("entered by the user.\n");
  19. > printf ("Enter your number: ____\b\b\b\b");
  20.  
  21.  
  22. A style point:
  23.     It is a good idea to make similar things look similar
  24.     and different things look different.
  25. Keywords like 'while', 'for', 'if' are quite different from
  26. function identifiers.  It is a good idea to make them visually
  27. distinct.  Two alternatives:
  28.     f(x, y, z);            f (x, y, z);
  29.     while (n > 0)            while(n > 0);
  30.  
  31. An implementation point:
  32.     Check your <math.h> to see if you have a function called gamma().
  33.