wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

KIG2007 - Revision (Function)

Total questions: 12

Worksheet time: 15mins

Name
Class
Date
1.

All C++ programs must contain at least one function. TRUE or FALSE?

a)

TRUE

b)

FALSE

2.

The two categories of functions are ... function and ... function.

a)

predefined, mathematical-library

b)

predefined, user-defined

c)

user-defined, statistical library

d)

predefined, customer-defined

3.

Which of the following statements is CORRECT when calling a function?

a)

x = calculate(int, int);

b)

calculate(int number);

c)

calculate(num);

d)

cout << calculate (int number);

4.

The outcome of the following program segment is 10, 100, 5, 11, ..., ..., ..., ... . Choose the CORRECT answer.

a)

12, 11, 12, 5

b)

12, 12, 13, 13

c)

12, 12, 13, 10

d)

12, 12, 13, 5

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)  

6.

The invoked function works on the "clone" and cannot modify the original copy. This statement refers to pass-by-...

(a)  

7.

Array is designed to be passed by ...

a)

value

b)

reference

8.

Write the output of this coding.

(a)  

9.

Write the output of this coding.

(a)  

10.

What is the output for the following program segment?

a)

Value is 5

b)

Value is 8

11.

What is the output for the following program segment?

a)

5

b)

6

c)

10

d)

11

12.

What will be printed out from line 10?

(a)