Quote Originally Posted by lifeless View Post
You mean put the (while<0) inside the other? i already do that, and the problem is when i enter a float number validates it then i enter a negative and doesn't validate it
No Salem means move your condition from while into loop body

Code:
while(fgets(buf,sizeof buf, stdin)== NULL ||
           sscanf(buf,"%d%n",&value,&end)!=1||
           !isspace(buf[end]))
    if(value < 0)