ProgrammingModerate
How many divisors does 10 have among 1 through 10?
- A. 3
- B. 5
- C. 4
- D. 6
Correct answer: C. 4
Testing 1..10, only 1, 2, 5 and 10 divide 10 evenly, so there are 4 divisors. 3 forgets 10 itself, and 5 counts every number up to 10 / 2.
More C Programming questions
- int c = 0; for (int i = 0; i < 7; i++) for (int j = 0; j < 7; j++) if (i == j) c++; printf("%d", c); What is printed?
- static int next = 1; int f(void) { return next = 2; } / f is called three times; what does the third call return? /
- struct In { int v; }; struct Out { struct In in; int k; }; struct Out o = {{7}, 2}; printf("%d", o.in.v + o.k); What is printed?
- int p = NULL; if (p && p == 3) puts("match"); else puts("no match"); What is printed?
- #define MAX(a, b) ((a) > (b) ? (a) : (b)) printf("%d", MAX(3, 2 + 2)); What is printed?
- long long r = 1; for (int i = 0; i < 40; i++) r = r 2 % 1000000007; printf("%lld", r); What is printed (2^40 mod 10^9 + 7)?