Now I change it into:<snip - code>
I know that now my only problem is "while ( ( nonnega_int =Change your loop to look like this:
getchar() ) != EOF )"
but I want to loop as what user want.
Should I add "int loop" or?
I must say, I haven't studied about "goto" and of course I don't know
how to use it.
In fact, now I only know use "while ( ( XXXX = getchar() ) != EOF )"
to control loop times,
and I think it should work.
What should I do?
// scanf line before the loop removed
while (scanf("%d", &nonnega_int) == 1)
{
// code to calculate factorial
}
This will loop around as long as the user enters valid numbers
(integers).
Bart v Ingen Schenau