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

  1. Xref: sparky comp.lang.c:17035 comp.lang.c++:16767 comp.misc:4376
  2. Newsgroups: comp.lang.c,comp.lang.c++,comp.misc
  3. Path: sparky!uunet!rexago8!aa
  4. From: aa@rexago8.uucp (Adam Andrews)
  5. Subject: Re: Confused
  6. Message-ID: <1992Nov23.142320.9675@rexago8.uucp>
  7. Organization: Summit Information Systems
  8. References: <957@hq.dla.mil>
  9. Date: Mon, 23 Nov 1992 14:23:20 GMT
  10. Lines: 30
  11.  
  12. fhi0055@hq.dla.mil (Marc Poole) writes:
  13.  
  14. [some code deleted]
  15. >printf ("Enter you number: ____\b\b\b\b");
  16. >scanf ("%d",&fact); 
  17.  
  18. >while 
  19. >{
  20. >    while (fact > 0)
  21. >       {
  22. >       count = count * fact--;
  23. >       }
  24. >answr = count;
  25. >printf ("%e", answr);
  26. >printf ("\n");
  27. >printf ("Enter another number or 0 to quit: ___\b\b\b");
  28.  
  29. I hope you have another scanf here; otherwise you will always have an infinite
  30. loop unless 0 is the first number they enter (assuming you implement the 
  31. solutions in the previous posts).
  32.  
  33. >}
  34.  
  35.  
  36. >printf ("\n");
  37. >}
  38.  
  39. -- 
  40. Adam Andrews                "When the going gets weird, we get even weirder."
  41. uunet!rexago8!aa or aa@rexago8.UUCP       e-mail only to aa@summitis.com
  42.