home *** CD-ROM | disk | FTP | other *** search
/ C by Discovery (4th Edition) / C_By_Discovery_4th_Edition.tar / C_By_Discovery_4th_Edition / CH_02 / 078.jpg < prev    next >
Joint Photographic Experts Group Image  |  2014-01-09  |  588KB  |  2550x3300
Labels: book | crt screen | reckoner
OCR: Chapter Gaining Control and the result is displ ayed int main( void int guess, pri intf( "I'm thinki but of an integer In" ; printf( "Try to guess now scanf( "d" guess test( guess TARGET printf "The number MaM sd.\n", TARGET return 0 / * * test() void test( int guess, int target guess target Note 1 printf( "TOO low. n" else guess target Note 2 printf "TOO h qh n" else Note 3 printf( "YOu guessed it!\n" An overview of this program reveals two functi ions, main and test One variable of type int is declared in main Calls to pri intf for output are followed by a call to scanf) for input. The functions test() is called and then pr intf() displays the answer to the guessing game. The compound else statement appears in the function test Note 1:The program needs to classify the user's guess as too ...