wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

C++ Workshop 2021 [Quiz-2]

Total questions: 10

Worksheet time: 5mins

Name
Class
Date
1.

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

a)

start()

b)

system()

c)

main()

d)

program()

2.
a)

Compile Error

b)

Inside Fun1()

c)

Inside Fun2()

d)

Inside Fun1() Inside Fun2()

e)

Inside Fun2() Inside Fun1()

3.

Switch Statement

a)

Is a statement with a set of conditions called cases

b)

Is a case

c)

Is a condition with no cases

d)

Is a boolean statement

4.

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

5.

If-else

a)

Optional value for the program to execute

b)

Is a condition followed by a statement or a set of statements

c)

Is a statement followed by a condition or a set of conditions

d)

Function with a value

6.

What is the difference when allocating the following memory?

int array1[15];

int array2[3][5];

a)

array1 is larger

b)

array2 is larger

c)

The size allocated is the same

7.

How to find Address of a variable

a)

*

b)

^

c)

&

d)

<<

8.

Which of the following is the correct syntax for declaring the array?

a)

int array [5]

b)

int array [5];

c)

Array[5];

d)

None of the above

9.

What are mandatory parts in the function declaration?

a)

parameters, function name

b)

parameters, variables

c)

return type, function name, parameters

d)

return type, function name

10.

What will be the output of the following C++ code?

a)

10

b)

0

c)

Error

d)

Segmentation fault