ProgrammingHardTCS NQT · Infosys
How many positive divisors does 40 have?
- A. 6
- B. 10
- C. 8
- D. 4
Correct answer: C. 8
The divisors are 1, 2, 4, 5, 8, 10, 20 and 40, which is 8. Pairing divisors up to sqrt(40) is the standard way to count them quickly.
More C Programming questions
- int next(void) { static int c = 0; return ++c; } Each of three calls returns its value, and the three returns are added together. What is…
- char s[] = "a0b"; What is strlen(s)?
- uint32t v = 0; for each digit d of the decimal string "4294967296", v = v 10 + d; What is v at the end?
- Using fib-like recursion where a stair can be climbed by 1 or 2 steps, the number of ways for 10 stairs is the recursion W(n) = W(n-1) +…
- What is sizeof "hi" in C?
- For unsigned a and b greater than 0 stored in uint32t, which test correctly detects that a b overflows?