Thread: Program that requests input of an integer number

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date
    Apr 2008
    Posts
    4

    Program that requests input of an integer number

    Help, I'm a C noob, and need help writing this program:

    The program will request input of an integer number. if the entered number matches a specific number(an ID number) it will continue. If the entered number does not match the specific number, it has to request a new number. If a "q" is entered it will quit.

    I have the basics of it down, I'm just wondering if and where to put a while loop in there, and I've come up with something kind of like this:

    #include <stdio.h>

    int main()
    {
    int idnumber;
    printf("Enter your student ID number:");
    scanf("&#37;d", &idnumber);
    if(idnumber==30922419)
    {
    printf("Correct: Please continue.")
    }

    }

    I know it's flawed, but I've been working on it for days. The main problem that i am having is getting the program to request the number, and what to do from there.

    I would appreciate any help.
    Last edited by theejuice; 04-29-2008 at 09:56 PM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 11
    Last Post: 10-07-2008, 06:19 PM
  2. Issue w/ Guess My Number Program
    By mkylman in forum C++ Programming
    Replies: 5
    Last Post: 08-23-2007, 01:31 AM
  3. large program code ,please help
    By Ash1981 in forum C Programming
    Replies: 14
    Last Post: 01-30-2006, 06:16 AM
  4. Program Loops Forver! HELP!
    By glossopjames in forum C Programming
    Replies: 6
    Last Post: 12-16-2004, 08:23 AM
  5. fopen();
    By GanglyLamb in forum C Programming
    Replies: 8
    Last Post: 11-03-2002, 12:39 PM