WorksheetsKIG2007 - Revision (Function)
Total questions: 12
Worksheet time: 15mins
All C++ programs must contain at least one function. TRUE or FALSE?
TRUE
FALSE
The two categories of functions are ... function and ... function.
predefined, mathematical-library
predefined, user-defined
user-defined, statistical library
predefined, customer-defined
Which of the following statements is CORRECT when calling a function?
x = calculate(int, int);
calculate(int number);
calculate(num);
cout << calculate (int number);
The outcome of the following program segment is 10, 100, 5, 11, ..., ..., ..., ... . Choose the CORRECT answer.
12, 11, 12, 5
12, 12, 13, 13
12, 12, 13, 10
12, 12, 13, 5
If the invoked function modifies the parameter, the same caller's copy will be modified as well. This statement refers to pass-by- (a)
The invoked function works on the "clone" and cannot modify the original copy. This statement refers to pass-by-...
(a)
Array is designed to be passed by ...
value
reference
Write the output of this coding.
(a)
Write the output of this coding.
(a)
What is the output for the following program segment?
Value is 5
Value is 8
What is the output for the following program segment?
5
6
10
11
What will be printed out from line 10?
(a)
