Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

FIXIT FEST - LEO CLUB (DAY - 2)

Total questions: 24

Worksheet time: 21mins

Name
Class
Date
1.

x = 5

y = 2

print(x * y + 3)

What will be the output of this code?

a)

10

b)

13

c)

15

d)

16

2.
  1. Which line contains the error in this Python code?

for i in range(5)

print(i)

a)
  • Line 1

b)

Line 2

c)

Line 1 & 2

d)

No Error

3.

what will be PRINTED ?

a)
  • [3, 4]

b)
  • [2, 3]

c)
  • [1, 2]

d)
  • [4, 5]

4.

a = 10

b = 3

c = a % b+3

print(c)

What is the output of this code?

a)
  • 3

b)
  • 2

c)
  • 4

d)
  • 1

5.
  1. Which line contains the error in this Java code?

public static void main(String[] args) {

int num = 2;

System.out.println(num / 0);

}

a)

Line 3

b)

Line 2

c)

Line 1

d)

No Error

6.

def multiply(a, b):

return a * b

result = multiply(4, 5)

print(result)

What will be printed?

a)

9

b)

N/A

c)

error

d)

20

7.
  1. What will be the value of x after the following code executes?

x = 0

for i in range(1, 6):

x += i

print(x)

a)

10

b)

25

c)

15

d)

20

8.

For the given image, What will be printed ?

a)

5

b)

2

c)

3

d)

None

9.

Which line contains the error in this C++ code?

(start numbering line from main() )

a)

Line 5

b)

Line 3

c)

Line 4

d)

No Error

10.

What will be Printed ?(Output)

a)

3

b)

8

c)

5

d)

9

11.

Output of the following ?

a)

5

b)

10

c)

3

d)

8

12.

def print_numbers():

for i in range(5):

print(i, end=" ")

print_numbers()

output for the above ?

a)
  • 0 1 2 3 4

b)
  • 0 1 2 3

c)
  • 1 2 3 4 5

d)
  • 1 2 3 4

13.

function multiply(a, b) {

return a * b ; }

console.log(multiply(2));

Which line contains the error in this JavaScript code?

a)

Line 1

b)

Line 2

c)

Line 3

d)

No Error

14.

def compute(num):

if num == 0:

return 1

else:

return num * compute(num-1)

result = compute(3)

What will be the value of result?

a)

6

b)

3

c)

1

d)

9

15.

What will be printed?

a)

16

b)

17

c)

18

d)

19

16.

What will be the output of this code?

a)

16

b)

32

c)

64

d)

128

17.

Spot the error in this C code :

a)

No Error

b)

Line 5

c)

Line 6

d)

Line 3

18.

What is the value of 'result' ?

a)

5

b)

15

c)

10

d)

8

19.

Output ?

a)

10

b)

12

c)

120

d)

24

20.

Which line contains Error ?

a)

Line 4

b)

Line 3

c)

Line 2

d)

No Error

21.

def func(x):

if x == 0:

return 0

else:

return x + func(x-1)

x = func(5)

what is the value of 'x' ?

a)

5

b)

20

c)

15

d)

10

22.

What will be the output of the following Python code?

for i in range(1, 6):

print(i * 2)

a)

2 4 6 8 10

b)

1 2 3 4 5

c)

3 6 9 12 15

d)

0 2 4 6 8

23.

Identify the error in the following Java code:

public static void main(String[] args) {

int x = 10;

System.out.println(x / 0);

}

a)

Line 3

b)

Line 2

c)

Line 1

d)

No Error

24.

What is the value of 'result' in the following JavaScript code?

function add(a, b) {

return a + b;

}

var result = add(5, 3);

a)

7

b)

8

c)

15

d)

53