home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c
- Path: sparky!uunet!think.com!ames!saimiri.primate.wisc.edu!zaphod.mps.ohio-state.edu!magnus.acs.ohio-state.edu!ctoth
- From: ctoth@magnus.acs.ohio-state.edu (Christopher M Toth)
- Subject: C if else statements HELP
- Message-ID: <1993Jan8.160740.22055@magnus.acs.ohio-state.edu>
- Sender: news@magnus.acs.ohio-state.edu
- Nntp-Posting-Host: magnusug.magnus.acs.ohio-state.edu
- Organization: The Ohio State University
- Date: Fri, 8 Jan 1993 16:07:40 GMT
- Lines: 30
-
- Hi! I just started learning C and have run into problems with
- 'if' and'else' statements. I have a program that I am *trying* to write. The
- basic format is:
-
- printf ("which do you choose?");
- scanf("%d", &n);
- choice#1
- choice#2
- choice#3
- choice#4
-
- if choice #1
- printf.....
- if choice #2
- printf.....
- if choice #3
- printf.....
- if choice #4
- printf.....
-
- I want the program to goto the approiate section when the user
- inputs either 1,2,3,or 4. ANy help would be greatly and mostly appreciated! :)
-
- Thanks!
-
- --
- Christopher M. Toth | "... We travel in the dark of a new moon
- The Ohio State University | A starry highway traced on the map of the sky
- Columbus State | Like lovers and heroes,
- CIS/History/Classics/ect..Major | Lonely as the eagle's cry..." -Peart
-