wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Weekly Contest #10 - TechXNinjas

Total questions: 10

Worksheet time: 5mins

Name
Class
Date
1.

Recursion is similar to which of the following?

a)

Switch Case

b)

Loop

c)

If-else

d)

If elif else

2.

What does the following function do?

a)

x + y

b)

x + x*y

c)

x*y

d)

xy

3.

The solution of the recurrence relation T(m) = T(3m / 4) + 1 is :

a)


θ (lg m)

b)

θ (m)

c)

θ (mlg m)

d)

θ (lglg m)

4.

What does f(173) print?

a)

010110101

b)

010101101

c)

10110101

d)

10101101

5.

What is the output of the following code for the input arr[]={1,2,3,4,5,6} N=6?

a)

0

b)

21

c)

7

d)

Error

6.

Total numbers of stars printed by this code is:

a)

n(n+1)

b)

n(n+1)/2

c)

2n(n-1)

d)

n(n-1)/2

7.

What is the output of the following code?

a)

10

b)

1

c)

1 to 10

d)

10 to 1

8.

Write the output of the following code?

(a)  

9.

What does the following function do?

a)
  • It returns 1 when n is a multiple of 3, otherwise returns 0

b)

It returns 1 when n is a power of 3, otherwise returns 0

c)

It returns 0 when n is a multiple of 3, otherwise returns 1

d)


It returns 0 when n is a power of 3, otherwise returns 1

10.

Which one of the following is TRUE?

a)

The function returns 0 for all values of j.

b)

The function prints the string something for all values of j.

c)

The function will exhaust the runtime stack or run into an infinite loop when j = 50

d)

The function returns 0 when j = 50.