home *** CD-ROM | disk | FTP | other *** search
/ C by Discovery (4th Edition) / C_By_Discovery_4th_Edition.tar / C_By_Discovery_4th_Edition / CH_08 / 453.jpg < prev    next >
Joint Photographic Experts Group Image  |  2014-01-29  |  650KB  |  2550x3300
Labels: book | crt screen | poster | reckoner
OCR: . Global versus Local Variables 453 delimits addit(; at any point other way of Note 4 the end of printf( 11 was sd; addit() returned d. \n" addit) ations must return 0 tatic can cal variable addit) ut does not nt addit( void ock will not Note 5 int sum sum sum counter; Note 6 return sum The program consists of the function main() and function addit (). In main the variable counter is declared and used to drive for loop The block that forms the body of the for loop contains the declaration of the variable 1 two assignment statements, pid call to addi final pri intf() call ends main The function addit contains the declaration of sum single assign- ment statement, and return statement Note 1 The variable counter is declared. Because declared inside the function block for ma in it1 local to ma ...