home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / lang / c / 19417 < prev    next >
Encoding:
Text File  |  1993-01-08  |  1.3 KB  |  42 lines

  1. Newsgroups: comp.lang.c
  2. Path: sparky!uunet!think.com!ames!saimiri.primate.wisc.edu!zaphod.mps.ohio-state.edu!magnus.acs.ohio-state.edu!ctoth
  3. From: ctoth@magnus.acs.ohio-state.edu (Christopher M Toth)
  4. Subject: C if else statements HELP
  5. Message-ID: <1993Jan8.160740.22055@magnus.acs.ohio-state.edu>
  6. Sender: news@magnus.acs.ohio-state.edu
  7. Nntp-Posting-Host: magnusug.magnus.acs.ohio-state.edu
  8. Organization: The Ohio State University
  9. Date: Fri, 8 Jan 1993 16:07:40 GMT
  10. Lines: 30
  11.  
  12.     Hi! I just started learning C and have run into problems with
  13. 'if' and'else' statements. I have a program that I am *trying* to write. The
  14. basic format is:
  15.  
  16.     printf ("which do you choose?");
  17.     scanf("%d", &n);
  18.     choice#1
  19.     choice#2
  20.     choice#3
  21.     choice#4
  22.  
  23.     if choice #1
  24.         printf.....
  25.     if choice #2
  26.         printf.....
  27.     if choice #3
  28.         printf.....
  29.     if choice #4
  30.         printf.....
  31.  
  32.     I want the program to goto the approiate section when the user
  33. inputs either 1,2,3,or 4. ANy help would be greatly and mostly appreciated! :)
  34.  
  35. Thanks!
  36.  
  37. -- 
  38. Christopher M. Toth             | "... We travel in the dark of a new moon
  39. The Ohio State University       | A starry highway traced on the map of the sky
  40. Columbus State                  | Like lovers and heroes,
  41. CIS/History/Classics/ect..Major | Lonely as the eagle's cry..." -Peart
  42.