home *** CD-ROM | disk | FTP | other *** search
/ C by Discovery (4th Edition) / C_By_Discovery_4th_Edition.tar / C_By_Discovery_4th_Edition / CH_12 / 677.jpg < prev    next >
Joint Photographic Experts Group Image  |  2013-12-12  |  566KB  |  2550x3300
Labels: book | crt screen | daybook | reckoner
OCR: Some Added Features 677 plicated control structure. .The following program is a rework of the program if3.c in example 2.6. The input and indino have been changed to use C++ stream 1/O the function odd has been changed to an inl ine function. and it returns type bool instead of type int Example 12-3: inlinel l.cpp inl inel .CPP Synopsis The prompts for and accepts input of decimal integer then tests to see that integer is even or odd The results -he test displayed Obj iective Illust rates functi ions and control stat ements in ++5 and the use of an inline funct ion that returns type bool Include Files tinclude <iostream h> Funct ion Prototypes inline bool odd int intvar Note 1 PRECONDITION: none POSTCONDITION intvar the functi returna false intvar odd the funct Lon retuirns true int main() ...