getting numbers

Discussion in 'C Programming' started by beginers of c, Nov 14, 2007.

  1. hai friends
    see i have to get numbers in this manner
    3 4 5 6 7 8 9
    ok.And also my numbers should not be larger than 9.so for each number
    the condition has to be checked if it's great than 9 , then the pgm
    should return 0.
    for above pgm
    when 3 is entered the condition should be checked,if it's
    correct then i should be allowed to enter the next number.
    beginers of c, Nov 14, 2007
    #1
    1. Advertising

  2. beginers of c

    Richard Bos Guest

    beginers of c <> wrote:

    > hai friends


    Hello, homework cheater. Be advised that I do not consider homework
    cheaters to be my friends.

    > see i have to get numbers in this manner
    > 3 4 5 6 7 8 9
    > ok.And also my numbers should not be larger than 9.so for each number
    > the condition has to be checked if it's great than 9 , then the pgm
    > should return 0.
    > for above pgm
    > when 3 is entered the condition should be checked,if it's
    > correct then i should be allowed to enter the next number.


    How about... you do your own homework? If you have made a decent
    attempt, show us what you have and tell us what your problem with it is.
    If you haven't had a good hard stab at it, do so now. You will never
    learn if you get others to do your homework for you.

    Richard
    Richard Bos, Nov 14, 2007
    #2
    1. Advertising

  3. beginers of c

    Shadowman Guest

    beginers of c wrote:
    > hai friends
    > see i have to get numbers in this manner
    > 3 4 5 6 7 8 9
    > ok.And also my numbers should not be larger than 9.so for each number
    > the condition has to be checked if it's great than 9 , then the pgm
    > should return 0.
    > for above pgm
    > when 3 is entered the condition should be checked,if it's
    > correct then i should be allowed to enter the next number.
    >


    There's a Coors Light commercial with former Coach Bill Parcells in a
    post-game press conference. An excerpt:

    Q: "Coach! I have a question! I love cold Coors Light!"

    Bill: "That's really not a question."

    --
    SM
    rot13 for email
    Shadowman, Nov 14, 2007
    #3
  4. beginers of c

    santosh Guest

    In article <>,
    beginers of c <> wrote on Wednesday 14 Nov 2007 9:48
    pm:

    > hai friends
    > see i have to get numbers in this manner
    > 3 4 5 6 7 8 9
    > ok.And also my numbers should not be larger than 9.so for each number
    > the condition has to be checked if it's great than 9 , then the pgm
    > should return 0.
    > for above pgm
    > when 3 is entered the condition should be checked,if it's
    > correct then i should be allowed to enter the next number.


    Look up your system's documentation for the Standard functions fgets()
    and strtol(). On UNIX systems you can use the 'man' command, for
    Windows browse your C Standard library's documentation, or failing
    that, see here: <http://www.dinkumware.com/manuals/>.

    Now attempt to solve the problem and post your code if you have problems
    or don't understand something.
    santosh, Nov 14, 2007
    #4
  5. beginers of c

    pete Guest

    santosh wrote:
    >
    > In article <>,
    > beginers of c <> wrote on Wednesday 14 Nov 2007 9:48
    > pm:
    >
    > > hai friends
    > > see i have to get numbers in this manner
    > > 3 4 5 6 7 8 9
    > > ok.And also my numbers should not be larger than 9.so for each number
    > > the condition has to be checked if it's great than 9 , then the pgm
    > > should return 0.
    > > for above pgm
    > > when 3 is entered the condition should be checked,if it's
    > > correct then i should be allowed to enter the next number.

    >
    > Look up your system's documentation for the Standard functions fgets()
    > and strtol(). On UNIX systems you can use the 'man' command, for
    > Windows browse your C Standard library's documentation, or failing
    > that, see here: <http://www.dinkumware.com/manuals/>.
    >
    > Now attempt to solve the problem
    > and post your code if you have problems
    > or don't understand something.


    I couldn't understand the specification.

    I have no idea what the example corresponding to "this manner"
    is supposed to be showing.

    This statement:
    "when 3 is entered the condition should be checked,if it's
    correct then i should be allowed to enter the next number."
    Why is that statement written as though
    we don't know whether or not entering 3 satisfies that condition?
    What condition are we talking about?

    --
    pete
    pete, Nov 14, 2007
    #5
  6. In article <>,
    pete <> wrote:
    >santosh wrote:
    >>
    >> In article <>,
    >> beginers of c <> wrote on Wednesday 14 Nov 2007 9:48
    >> pm:


    >> > And also my numbers should not be larger than 9.so for each number
    >> > the condition has to be checked if it's great than 9 , then the pgm
    >> > should return 0.


    >This statement:
    >"when 3 is entered the condition should be checked,if it's
    > correct then i should be allowed to enter the next number."
    >Why is that statement written as though
    >we don't know whether or not entering 3 satisfies that condition?
    >What condition are we talking about?


    The condition of not being greater than 9?


    > > see i have to get numbers in this manner
    > > 3 4 5 6 7 8 9
    > > ok.And also my numbers should not be larger than 9.so for each number
    > > the condition has to be checked if it's great than 9 , then the pgm
    > > should return 0.
    > > for above pgm
    > > when 3 is entered the condition should be checked,if it's
    > > correct then i should be allowed to enter the next number.


    If the numbers are supposed to be entered on a single line, as
    showin "in this manner", then to "be allowed to enter the next number"
    implies that after number greater than 9 is found, that the
    user should not be "allowed" to enter further numbers on the same line.
    That implies examining the input as it is typed, not just when the
    line is completed. Unfortunately for the original poster, examining
    input as it is typed in is not something that can be done with the
    facilities provided by the C I/O library, and requires system-specific
    extensions.

    --
    "Beware of bugs in the above code; I have only proved it correct,
    not tried it." -- Donald Knuth
    Walter Roberson, Nov 14, 2007
    #6
  7. beginers of c

    pete Guest

    Walter Roberson wrote:
    >
    > In article <>,
    > pete <> wrote:


    > >This statement:
    > >"when 3 is entered the condition should be checked,if it's
    > > correct then i should be allowed to enter the next number."
    > >Why is that statement written as though
    > >we don't know whether or not entering 3 satisfies that condition?
    > >What condition are we talking about?

    >
    > The condition of not being greater than 9?


    It seems strange to discuss what a program should do,
    *if* 3 turns out to be not greater than 9.

    --
    pete
    pete, Nov 15, 2007
    #7
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Subra
    Replies:
    25
    Views:
    1,174
    user923005
    Mar 8, 2007
  2. Andrew Tatum

    Fibonacci Numbers and Lucas Numbers

    Andrew Tatum, May 26, 2007, in forum: C++
    Replies:
    6
    Views:
    546
    Howard
    May 27, 2007
  3. Lance Hoffmeyer
    Replies:
    2
    Views:
    514
    Lance Hoffmeyer
    Jul 26, 2007
  4. jko170
    Replies:
    9
    Views:
    120
    jko170
    Jan 21, 2009
  5. GIMME
    Replies:
    5
    Views:
    178
    Thomas 'PointedEars' Lahn
    Jul 26, 2004
Loading...

Share This Page