Sams Teach Yourself C in 21 Days

(singke) #1
Find the Number 95

If you want to cheat, you can add a line to the program that prints the answer after the
program generates it. You might want to add this cheat into the program after you first
compile it:
26: printf( “The random number (answer) is: %d”, number ); /* cheat */

This will let you see that the program works correctly. If you decide to give the running
program to your friends, make sure to take the cheat line out!

08 448201x-T&R2 8/13/02 11:20 AM Page 95

Free download pdf