wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

CPP MX

Total questions: 86

Worksheet time: 45mins

Name
Class
Date
1.

C++ is an ____________________ that is an

extension of the procedural C programming language

a)

subjective programming language

b)

objective programming language

c)

object-oriented programming language

d)

subject-oriented programming language

2.

_________________ are used to make functions within the

standard C++ libraries available to a program

a)

Processor directives

b)

Preprocessor directives

c)

Administrator

directives

d)

Program directives

3.

Each C++ program must contain only __________ as the

entry point to the program

a)

one method

b)

a method

c)

two method

d)

one main method

4.

It define the actions that the program will execute

a)

Expressions

b)

Equations

c)

Questions

d)

Statements

5.

A ______________ specifies a data type and a chosen name

by which the value within that variable can be referenced

a)

variable declaration

b)

variable specification

c)

variable

code

d)

fixed declaration

6.

The cout function, which is part of the C++ _____ library,

writes content to the standard output console

a)

istream

b)

iostream

c)

stream

d)

conio

7.

An array is a fixed size variable that stores multiple items of

data in elements, which are numbered starting at ____

a)

two

b)

one

c)

zero

d)

-1

8.

A vector variable stores multiple items of data in elements and

can be dynamically resized

a)

TRUE

b)

FALSE

9.

A vector variable stores multiple items of data in elements and

cannot be dynamically resized

a)

TRUE

b)

FALSE

10.

The value stored in an array or vector element can be

referenced using that variable’s name and its index number

a)

TRUE

b)

FALSE

11.

The value stored in an array or vector element can be

referenced using that variable’s name and its index finger

a)

TRUE

b)

FALSE

12.

Variable values that are never changed by the program should

be stored in a constant

a)

TRUE

b)

FALSE

13.

Variable values that are changed by the program should

be stored in a constant

a)

TRUE

b)

FALSE

14.

A constant list can be automatically numbered by the enum

keyword and given a type name by the typedef keyword

a)

TRUE

b)

FALSE

15.

A variable list can be automatically numbered by the enum

keyword and given a type name by the typedef keyword

a)

TRUE

b)

FALSE

16.

C++ was developed by Dr. Bjarne Stroustrup between 1983-1985

a)

TRUE

b)

FALSE

17.

C was developed by Dr. Bjarne Stroustrup between 1983-1985

a)

TRUE

b)

FALSE

18.

C++ was developed by Dr. Bjarne Strustroup between 1983-1985

a)

TRUE

b)

FALSE

19.

C++ was developed by Dr. Bjarne Stroustrup between 1986-1988

a)

TRUE

b)

FALSE

20.

C was developed by Dennis Ritchie in 1972

a)

TRUE

b)

FALSE

21.

C was developed by Dennis Richards in 1972

a)

TRUE

b)

FALSE

22.

C++ was developed by Dennis Ritchie in 1972

a)

TRUE

b)

FALSE

23.

C was developed by Dennis Richards in 1975

a)

TRUE

b)

FALSE

24.

C was developed by Dennis Richards in 1975

a)

TRUE

b)

FALSE

25.

"IDE" means Integrated Development Environment

a)

TRUE

b)

FALSE

26.

"IDE" means International Development Environment

a)

TRUE

b)

FALSE

27.

"ANSI" means American National Standards Institute

a)

TRUE

b)

FALSE

28.

"ANSI" means American National Standards Institution

a)

TRUE

b)

FALSE

29.

"IOS" means International Organization for Standardization

a)

TRUE

b)

FALSE

30.

"ISO" means International Organization for Standardization

a)

TRUE

b)

FALSE

31.

Computers can only understand machine language

a)

TRUE

b)

FALSE

32.

Computers can only understand 0's and 1's

a)

TRUE

b)

FALSE

33.

Computers can only understand Binary Digits

a)

TRUE

b)

FALSE

34.

In this programming language, each instruction is identified by a short abbreviation and names and other numbers can be used.

a)

High level language

b)

Assembly Language

c)

English language

d)

Machine language

35.

These programming languages are designed to allow the programmer to write programs without having to be as concerned about what kind of computer the program will be run on

a)

High level language

b)

Assembly Language

c)

English language

d)

Machine language

36.

___________ is a program that reads source code and produces a stand-alone executable program that can then be run

a)

Assembler

b)

Compiler

c)

Software

d)

Code

37.

______________ is a program that directly executes the instructions in the source code without requiring them to be compiled into an executable first.

a)

Compiler

b)

Assembler

c)

Interpreter

d)

Code

38.

Back when computers were first invented, programmers had to write programs directly in machine language, which was a very difficult and time consuming thing to do

a)

TRUE

b)

FALSE

39.

The smallest unit of data that a computer can process and store is called bit

a)

TRUE

b)

FALSE

40.

The smallest unit of data that a computer can process and store is called data

a)

TRUE

b)

FALSE

41.

What is the only function all C++ programs must contain?

a)

start()

b)

system()

c)

main()

d)

program()

42.

What punctuation is used to signal the beginning and end of code blocks?

a)

{ }

b)

-> and <-

c)

BEGIN and END

d)

( and )

43.

Which of the following is a correct comment?

a)

*/ Comments */

b)

** Comment **

c)

/* Comment */

d)

{ Comment }

44.

The process of giving a value to a variable

a)

declaration

b)

naming

c)

instantiation

d)

assigning

45.
A list of instructions that enable a computer to perform a specific task is a...
a)
Computer Program
b)
Algorithm
c)
Machine Code
d)
Binary Code
46.
A programmer is:
a)
person who writes code and communicates instructions to a computer
b)
person who types
c)
person who studies computers
d)
error or mistake in your code
47.
What is the output of this program?
Program
int main()
{
cout<<"Hi everybody";
return 0;
}
a)
"Hi everybody"
b)
Hi everybody"
c)
Hi everybody
d)
"Hi everybody
48.
... point variables store decimal numbers (3.5, -5,123, 4.0, etc). 
a)
Float
b)
Integer
c)
Logical
d)
Character
49.

An array is a variable that can store multiple items of data

– unlike a regular variable, which can only store one piece of data.

a)

TRUE

b)

FALSE

50.

A “variable” is like a container in a C++ program in which a data

value can be stored inside the computer’s memory.

a)

TRUE

b)

FALSE

51.

________________operators can form expressions with two

operands for addition +, subtraction -, multiplication *,

division /, or modulus %

a)

Arithmetic

b)

Logical

c)

Local

d)

International

52.

___________ operators can form expressions comparing two

operands for equality ==, inequality !=, greater >, lesser <,

greater or equal >=, and lesser or equal <= values

a)

Arithmetic

b)

Logical

c)

Ternary

d)

Comparison

53.

The logical ___ operator returns the inverse boolean value of a

single operand

a)

!

b)

i

c)

&&

d)

||

54.

Logical && and || operators form expressions evaluating two

operands to return a boolean value of true or false

a)

!

b)

i

c)

&&

d)

||

55.

It means "add 1 to variable"

a)

--

b)

&&

c)

++

d)

||

56.

It means "subtract 1 to variable"

a)

--

b)

&&

c)

++

d)

||

57.

____ and ____operators modify a single

operand by a value of one

a)

--

b)

&&

c)

++

d)

||

58.

The assignment = operator can be combined with an

arithmetical operator to perform an arithmetical calculation

then assign its result

a)

TRUE

b)

FALSE

59.

The logical i operator returns the inverse boolean value of a

single operand

a)

TRUE

b)

FALSE

60.

Comparison operators can form expressions with two

operands for addition +, subtraction -, multiplication *,

division /, or modulus %

a)

TRUE

b)

FALSE

61.

Arithmetic operators can form expressions with two

operands for addition +, subtraction -, multiplication *,

division /, or modulus %

a)

TRUE

b)

FALSE

62.

Comparison operators can form expressions comparing two

operands for equality ==, inequality !=, greater >, lesser <,

greater or equal >=, and lesser or equal <= values

a)

TRUE

b)

FALSE

63.

Logical operators can form expressions comparing two

operands for equality ==, inequality !=, greater >, lesser <,

greater or equal >=, and lesser or equal <= values

a)

TRUE

b)

FALSE

64.

TRUE OR TRUE IS

a)

TRUE

b)

FALSE

65.

TRUE OR FALSE IS

a)

TRUE

b)

FALSE

66.

FALSE OR FALSE IS

a)

TRUE

b)

FALSE

67.

FALSE AND FALSE IS

a)

TRUE

b)

FALSE

68.

TRUE AND FALSE IS

a)

TRUE

b)

FALSE

69.

TRUE AND TRUE IS

a)

TRUE

b)

FALSE

70.

FASLE AND TRUE IS

a)

TRUE

b)

FALSE

71.

FASLE OR TRUE IS

a)

TRUE

b)

FALSE

72.

The statement x /= y means

a)

x = (x/y)

b)

x = (x+y)

c)

x = (x*y)

d)

x = (x-y)

73.

The statement x++ means

a)

x = x + 1

b)

x = (x + 1)

c)

x = (x * 1)

d)

x = (x - 1)

74.

1 < 0

a)

TRUE

b)

FALSE

75.

0 > 1

a)

TRUE

b)

FALSE

76.

0 < 1

a)

TRUE

b)

FALSE

77.

1 > 0

a)

TRUE

b)

FALSE

78.

1 != 0

a)

TRUE

b)

FALSE

79.

0 != 1

a)

TRUE

b)

FALSE

80.

!0

a)

TRUE

b)

FALSE

81.

!1

a)

TRUE

b)

FALSE

82.

How many iterations will the for loop have?

a)

9

b)

10

c)

11

d)

12

83.

What value of the step increment of the variable n ?

a)

0

b)

1

c)

2

d)

3

84.

What will be the value of m on the 5th iteration?

a)

8

b)

9

c)

10

d)

11

85.

What will be the value of n on the final iteration?

a)

8

b)

9

c)

10

d)

11

86.

What will be the value of m on the final iteration?

a)

16

b)

10

c)

20

d)

22