What is wrong with the following code, which attempts to return the number of factors of a

Question:

What is wrong with the following code, which attempts to return the number of factors of a given integer n? Describe how to fix the code.

public static int countFactors (int n) { for (int i = 1; i

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Related Book For  book-img-for-question
Question Posted: