Computer Science - Object Oriented Programming Using C++

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++

Answer: Option B

Explanation:

No answer description available for this question. Let us discuss.

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

Answer: Option A

Explanation:

No answer description available for this question. Let us discuss.

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

Answer: Option A

Explanation:

No answer description available for this question. Let us discuss.

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

Answer: Option B

Explanation:

No answer description available for this question. Let us discuss.

30. 

The C++ _____ function generates random numbers

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

Answer: Option E

Explanation:

No answer description available for this question. Let us discuss.