Object Oriented Programming Using C++ – Section 9


Warning: Undefined variable $ext in /www/wwwroot/gkfeed.com/public_html/wp-content/plugins/show-hidecollapse-expand/bg_show_hide.php on line 281

Warning: Undefined variable $ext in /www/wwwroot/gkfeed.com/public_html/wp-content/plugins/show-hidecollapse-expand/bg_show_hide.php on line 281

Warning: Undefined variable $ext in /www/wwwroot/gkfeed.com/public_html/wp-content/plugins/show-hidecollapse-expand/bg_show_hide.php on line 281

Warning: Undefined variable $ext in /www/wwwroot/gkfeed.com/public_html/wp-content/plugins/show-hidecollapse-expand/bg_show_hide.php on line 281

Warning: Undefined variable $ext in /www/wwwroot/gkfeed.com/public_html/wp-content/plugins/show-hidecollapse-expand/bg_show_hide.php on line 281

26. Local variables _____

A. are created outside a block
B. are known only to that block
C. continue to exist when their block ends
D. are illegal in C++

Correct Answer:   B. are known only to that block
Advertisement

27. # directives must be present

A. before the main() function
B. after the main() function
C. at the end of the program
D. anywhere in the program body
E. None of the above

Correct Answer:   A. before the main() function
Advertisement

28. Programmers prefer to declare almost all variables _____

A. at the beginning of each function
B. globally
C. on one line
D. with cryptic names

Correct Answer:   A. at the beginning of each function
Advertisement

29. A(n) _____ is always incremented by a constant amount, whereas a(n) _____ is incremented by an amount that varies

A. accumulator, counter
B. counter, accumulator

Correct Answer:   B. counter, accumulator
Advertisement

30. The C++ _____ function generates random numbers

A. generate()
B. genRand
C. rand
D. randGen
E. srand

Correct Answer:   E. srand
Advertisement

Warning: Undefined variable $in_same_cat in /www/wwwroot/gkfeed.com/public_html/wp-content/plugins/EXP.GKFEED.COM/function.php on line 27

Warning: Undefined variable $excluded_categories in /www/wwwroot/gkfeed.com/public_html/wp-content/plugins/EXP.GKFEED.COM/function.php on line 27

Leave A Comment?