You can't compare strings with ==. You need something like strcmp. Or you could do what you're doing later on there, and compare individual characters. I'm not sure why you're going back and forth. You shouldn't use gets either. You should just make a function that checks your input and returns something if it's OK, and something else if it's not.
Code:
int checkinput( char input[], int len )
{
if input[0] is n
return OK (optionally, return something else saying they wanted to quit)
else
for each character in
if you found a non-number
return NOT OK
else
you reached the end and just had numbers so return OK
}
Quzah.