Question 21
EasyWhat is 5! ÷ 3!?
- A.
2
Popular companies
Prepare company by company
Hiring pattern, syllabus, past questions and mocks for each company.
All companiesPractice by subject
Data Structures and Algorithms
What is 5! ÷ 3!?
2
60
120
20
Sign up free to see the answer and a step-by-step explanation.
What is C(5, 2), the number of ways to choose 2 items from 5?
20
10
25
5
Sign up free to see the answer and a step-by-step explanation.
Which of these numbers is composite even though it looks prime?
91
83
97
89
Sign up free to see the answer and a step-by-step explanation.
What is the output of this code?
print(pow(3, 4, 7))
4
3
12
81
Sign up free to see the answer and a step-by-step explanation.
What is the output of this code?
n, s = 9875, 0
while n:
s += n % 10
n //= 10
print(s)
9875
2
Sign up free to see the answer and a step-by-step explanation.
What is the output of this code?
import math
print(math.gcd(54, 24))
2
6
216
12
Sign up free to see the answer and a step-by-step explanation.
What is a composite number?
A number made of two digits
Any odd number
A prime number
A whole number greater than 1 that has a divisor other than 1 and itself
Sign up free to see the answer and a step-by-step explanation.
What is the output of this code?
n = 20
is_p = [True] * n
is_p[0] = is_p[1] = False
for i in range(2, int(n ** 0.5) + 1):
if is_p[i]:
for j in range(i * i, n, i):
is_p[j] = False
print([i for i in range(n) if is_p[i]])
[1, 2, 3, 5, 7, 11, 13, 17, 19]
[2, 3, 5, 7, 11, 13, 17, 19]
Sign up free to see the answer and a step-by-step explanation.
What is the time complexity of the Sieve of Eratosthenes up to n?
O(√n)
O(n log log n)
O(n²)
O(n log n)
Sign up free to see the answer and a step-by-step explanation.
What is the output of this code?
print(pow(2, 10, 1000))
1024
24
4
0
Sign up free to see the answer and a step-by-step explanation.
30
29
[3, 5, 7, 11, 13, 17, 19]
[2, 3, 5, 7, 9, 11, 13, 15, 17, 19]