wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

QUIZ CC 102 (FUNCTIONS)

Total questions: 15

Worksheet time: 9mins

Name
Class
Date
1.

It means that the functions does not have a return value.

a)

void

b)

viod

c)

int

d)

string

2.

It is inside the function where you can add code(s) that defines what function should do.

a)

declaration

b)

definition/function body

c)

parameters

d)

void

3.

This part of c++ function that consists of the return type, the name of the function and the parameters (if any)

a)

Function Declaration

b)

Function Definition

c)

arguments

d)

parameters

4.

This part of c++ function that consist of the body of the function or the code to be executed.

a)

Function Declaration

b)

Function Definition

c)

arguments

d)

parameters

5.

These are specified after the function name, inside the parentheses. Also act as variables inside the function.

a)

variables

b)

return type

c)

parameters

d)

function

6.

Give the syntax to call a function with out paramater named "myFunction".

(a)  

7.

Give the syntax to declare a function without parameter named "myFunction".

(a)  

8.

These are modules or segments of code that perform individual tasks.

(a)  

9.

A parameter with a default value, is often known as (a)   ?

10.

This can be useful when you need to change the value of the arguments.

(a)  

11.

TRUE or FALSE: You can also pass arrays as function parameters.

a)

TRUE

b)

FALSE

12.

TRUE or FALSE: In C++, a function is a single statements that is given a name, and which can be called from some point in the program

a)

TRUE

b)

FALSE

13.

TRUE or FALSE: Functions are used to perform certain actions, and they are important for reusing code: Define the code once, and use it many times.

a)

TRUE

b)

FALSE

14.

TRUE or FALSE: To declare a function, specify the name of the function, followed by the square brackets.

a)

TRUE

b)

FALSE

15.

TRUE or FALSE: Declared functions are not executed immediately. They are “saved for later use”, will be executed later, when they are called.

a)

TRUE

b)

FALSE