WorksheetsCOMP PROG 2 MOCK EXAM
Total questions: 24
Worksheet time: 24mins
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)
What is the term of detecting or locating error in programming language?
(a)
Indicate the beginning and end of a function (also called a code block)
(a)
A collection of commands that “do something”
(a)
Escape sequences always begin with a (a)
Indicates the end of the statement
(a)
This statement terminates the main() function and returns the value 0 to the calling process.
(a)
(a) is a location in memory to hold data.
To indicate the storage area, each variable should be given a unique name
(a)
It translates source code to object code that is executable.
(a)
The C++ programming language is not case sensitive
TRUE
FALSE
Declare an integer variable num.
(a)
Performs mathematical operations such as addition, subtraction, and multiplication on numerical values(constants and variables).
(a)
It is used to assign a particular value to a variable.
(a)
Is a symbol that tells the
compiler or interpreter to perform specific mathematical, relational or
logical operation and produce final result.
(a)
Two special operators that are used to increase and
decrease the value of a variable by 1.
(a)
An expression containing _______ _______ returns either 0 or 1 depending upon whether expression results true or false.
(a)
You can declare multiple variables on single line by separating them with a (a)
Is a series of characters surrounded by double quotes.
(a)
It executes statements when an expression is true.
(a)
It executes the if block of statement if the condition/expression is true otherwise else block of statement is executed.
(a)
Statement executes one condition from multiple
statements. We can create multiple branches using the else if keyword.
(a)
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)
A logical operator returns a true result only when both expressions are true.
(a)
