rand () % 10 gives values from 0-9.
gcc -Wall -Werror -ansi -pedantic code.c
Type: Posts; User: robwhit
rand () % 10 gives values from 0-9.
gcc -Wall -Werror -ansi -pedantic code.c
Perhaps make the number in a smaller range so that somebody can actually guess it. If you guess it, the getchar doesn't pause the program because it gets the newline entered from the previous scanf.