wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

COMP PROG 2 MOCK EXAM

Total questions: 24

Worksheet time: 24mins

Name
Class
Date
1.

What do we call a violation of the rule set by programming language and a typographical error or incorrect format of the statement used?

(a)  

2.

What is the term of detecting or locating error in programming language?

(a)  

3.

Indicate the beginning and end of a function (also called a code block)

(a)  

4.

A collection of commands that “do something”

(a)  

5.

Escape sequences always begin with a (a)  

6.

Indicates the end of the statement

(a)  

7.

This statement terminates the main() function and returns the value 0 to the calling process.

(a)  

8.

(a)   is a location in memory to hold data.

9.

To indicate the storage area, each variable should be given a unique name

(a)  

10.

It translates source code to object code that is executable.

(a)  

11.

The C++ programming language is not case sensitive

a)

TRUE

b)

FALSE

12.

Declare an integer variable num.

(a)  

13.

Performs mathematical operations such as addition, subtraction, and multiplication on numerical values(constants and variables).

(a)  

14.

It is used to assign a particular value to a variable.

(a)  

15.

Is a symbol that tells the

compiler or interpreter to perform specific mathematical, relational or

logical operation and produce final result.

(a)  

16.

Two special operators that are used to increase and

decrease the value of a variable by 1.

(a)  

17.

An expression containing _______ _______ returns either 0 or 1 depending upon whether expression results true or false.

(a)  

18.

You can declare multiple variables on single line by separating them with a (a)  

19.

Is a series of characters surrounded by double quotes.

(a)  

20.

It executes statements when an expression is true.

(a)  

21.

It executes the if block of statement if the condition/expression is true otherwise else block of statement is executed.

(a)  

22.

Statement executes one condition from multiple

statements. We can create multiple branches using the else if keyword.

(a)  

23.

This type of selection control flow allows the value of a variable or expression

to control the flow of a program execution via a multi-way branch.

(a)  

24.

A logical operator returns a true result only when both expressions are true.

(a)