getting numbers

B

beginers of c

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.
 
R

Richard Bos

beginers of c said:
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
 
S

Shadowman

beginers said:
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."
 
S

santosh

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.
 
P

pete

santosh said:
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?
 
W

Walter Roberson

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?


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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top