wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

C++ Knowledge Based Quiz I = IA

Total questions: 15

Worksheet time: 5mins

Name
Class
Date
1.

Do while loops

a)

Runs a statement once

b)

Runs a statement twice

c)

Runs a statement multiple times or not within a boolean condition

d)

Doesn't run at all

2.

iostream

a)

Displays output from the screen and input from the keyboard

b)

Has all the math equations

c)

Counts the time

d)

Checks if the code has a function

3.

The process of creating a new variable without value

a)

declaration

b)

naming

c)

instantiation

d)

assigning

4.

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

a)

start()

b)

system()

c)

main()

d)

program()

5.

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

a)

-> and <-

b)

{ }

c)

BEGIN and END

d)

( and )

6.

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

7.

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

8.

Which of the following is NOT a comparison operator in C++ language?

a)

>

b)

<=

c)

=

d)

==

9.

Choose a right C Statement.

a)

Loops or Repetition block executes a group of statements repeatedly.

b)

Loop is usually executed as long as a condition is met.

c)

Loops usually take advantage of Loop Counter

d)

All the above.

10.

int main ()

{

int x = 24, y = 39, z = 45;

z = x + y;

y = z - y;

x = z - y;

printf ("%d %d %d", x, y, z);

}

a)

24 39 63

b)

39 24 63

c)

24 39 45

d)

39 24 45

11.

A function can have _____ inside the parenthesis

a)

loops

b)

Arguments/Parameters

c)

Braces

d)

Types

12.

A function that has no return type starts with:

a)

int

b)

void

c)

Arguments

d)

Braces

13.

A function that returns a whole number starts with the word

a)

int

b)

void

c)

string

d)

{ }

14.

What is the type of the temp variable?

var temp = 14.55;

a)

Double

b)

Boolean

c)

Integer

d)

String

15.

... is a set of ordered steps for solving a particular  problem. 

a)

An algorithm

b)

Program language

c)

Operator

d)

Variable