Question 11
EasyHow is the LCM of a and b computed from their GCD?
- A.
Popular companies
Prepare company by company
Hiring pattern, syllabus, past questions and mocks for each company.
All companiesPractice by subject
Data Structures and Algorithms
How is the LCM of a and b computed from their GCD?
LCM = a + b − GCD
LCM = GCD²
LCM = a ÷ b
LCM = a × b ÷ GCD(a, b)
Sign up free to see the answer and a step-by-step explanation.
How many prime numbers are less than 20?
10
8
9
7
Sign up free to see the answer and a step-by-step explanation.
What is 17 mod 5?
3
5
2
12
Sign up free to see the answer and a step-by-step explanation.
What is the output of this code?
print(-7 % 3)
-2
2
-1
1
Sign up free to see the answer and a step-by-step explanation.
What is a perfect number?
Any even number
A perfect square
A number equal to the sum of its proper divisors, such as 6 or 28
A number with no divisors
Sign up free to see the answer and a step-by-step explanation.
What is the formula for the sum of the first n natural numbers?
n(n + 1)/2
2ⁿ − 1
n²
n(n − 1)
Sign up free to see the answer and a step-by-step explanation.
What is 2¹⁰?
2048
1000
512
1024
Sign up free to see the answer and a step-by-step explanation.
How many digits does 10⁵ have?
5
10
4
6
Sign up free to see the answer and a step-by-step explanation.
What is the time complexity of fast (binary) exponentiation to compute aⁿ?
O(n)
O(log n)
O(n²)
O(1)
Sign up free to see the answer and a step-by-step explanation.
Which identity is used to keep sums small in modular arithmetic?
(a + b) mod m = a × b
(a + b) mod m = a + b + m
(a + b) mod m = m − a − b
(a + b) mod m = ((a mod m) + (b mod m)) mod m
Sign up free to see the answer and a step-by-step explanation.