Then use rand() to get a pseudo-random number whenever you need it. Using % 10 means to clamp the returned random number to the range 0..9.
If you are doing a full-blown console game, look into the Curses library NCurses
platform: POSIX
where: http://www.gnu.org/software/ncurses/
If you are on Unix, you've probably already got it installed.
If you are on Linux, use sudo apt-get install ncurses-dev or somesuch.
Link with -lcurses (on Solaris link with -lncurses).
PDCurses
platform: DOS, Win32, OS/2, Plan 9, SNES, etc.
where: http://pdcurses.sourceforge.net/
Works nicely with MinGW.
Link with -lpdcurses.
You can do system("CLS"); but professionals on this forum don't like it because it is hated by the Antivirus and is slow and leaves a BIG, BAD, GAPING security hole.
Other people suggest you can print out 100 lines so instead of clearing the screen it just pushes the text all the way up to the top (I forgot how to do that :P)