wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

debug quiz part 2

Total questions: 25

Worksheet time: 15mins

Name
Class
Date
1.

What is the output

a)

l=1,M=1

b)

l=6 M=5

c)

l=4,M=5

d)

l=5,M=6

2.

What is the output?

a)

720

b)

5040

c)

830

d)

none of these

3.

What is the output?

a)

#0#1#1#2#3#4#5#

b)

0#1#1#2#3#4#5#6##

c)

#0#1#2#3#4#5#6

d)

#0#1#1#2#3#4#5#6#7#8#9#10

4.

This program will print the

a)

soft limit of the size of the file in bytes that can be created by the process

b)

hard limit of the size of the file in bytes that can be created by the process

c)

soft 7 hard limit of the size of the file in bytes that can be created by the process

d)

none of the mentioned

5.

What is the output of this program?


a)

maximum numbers of the file that can store in this directory

b)

maximum length of a filename in this directory that the process is allowed to create

c)

none of the mentioned

d)

segmentation fault

6.

What is the output?

a)

Error

b)

-1

c)

1

d)

0

7.

Given a string example=”hello” what is the output of example.count(‘l’)?

a)

1

b)

2

c)

3

d)

0

8.

What is the output

a)

30

b)

error

c)

40

d)

870

9.

What is the output?

a)

17

b)

20

c)

21

d)

18

10.

What is meant by a polymorphism in C++?

a)

class having only single form

b)

class having four forms

c)

class having many forms

d)

class having two forms

11.

To concatenate two strings to a third what statements are applicable?

a)

s3 = s1 . s2

b)

s3 = s1.add(s2)

c)

s3 = s1.__add__(s2)

d)

s3 = s1 * s2

12.

i = 0

while i < 5:

print(i)

i+= 1

if i == 3:

break

else:

print(0)

a)

0 1 2 0

b)

0 1 1

c)

0 1 2

d)

Error

13.

What will print?

a)

nothing will print

b)

“sanfoundry” will print 5 times

c)

program will generate syntax error

d)

none of the mentioned

14.

Pick the incorrect statement about inline functions in C++?

a)

Saves overhead of a return call from a function

b)

They are generally very large and complicated function

c)

These functions are inserted/substituted at the point of call

d)

They reduce function call overheads

15.

What is the output?

a)

5

b)

6

c)

syntax error

d)

Value error

16.

What are the two main types of functions in Python?

a)

Built in function

b)

System function

c)

Built in function and user defined function

d)

Both a and b

17.

What is the output?

a)

success

b)

fail

c)

compilation error

d)

logical error

18.

Which concept allows you to reuse the written code in C++?

a)

Abstraction

b)

Interface

c)

Inheritance

d)

Polymorphism

19.

apple = mango

What is the error?

a)

Syntax error

b)

Value error

c)

Name error

d)

Type error

20.

What is the output?

a)

72

b)

56

c)

88

d)

75

21.

Which of the following is true

a)

a is assigned a value of 1

b)

b is assigned a value of [2,3]

c)

b is assigned a value of (2,3)

d)

b is assigned a value of 2

22.

What is the output of the code above ?

a)

1 4

b)

1

c)

1 None

d)

1 [2,3,4]

e)

1 (2,3,4)

23.

What does the picture represent?

a)

Byte

b)

Code

c)

Switche

d)

Bit

24.

What is the output of the code above

a)

[3.6, 3.7, 3.8, 4]

b)

[101, 102, 103, 104]

c)

[100,200,300,400]

d)

[3.7,3.9,103,455]

25.

Result of the program above is

a)

('1', '2', '3', '4', '5')

b)

(1, 2, 3, 4, 5)

c)

12345

d)

"12345"