![subject](/tpl/images/cats/informatica.png)
Computers and Technology, 11.10.2019 19:30 reyesdaisy858
Consider the task of writing a method named countfactors that accepts an integer (assumed to be positive) as its parameter and returns a count of its positive factors. for example, the six factors of 12 are 1, 2, 3, 4, 6, and 12, so the call countfactors(12) should return 6. the following is an attempt at solving the problem, but it is incorrect. determine what is wrong with the code, and submit a corrected version that works properly. public static int countfactors(int n) {
for (int i = 1; i < = n; i++) {
if (n % i == 0) { // a factor
return i;
}
}
}
![ansver](/tpl/images/cats/User.png)
Answers: 3
![](/tpl/images/ask_question.png)
![](/tpl/images/ask_question_mob.png)
Other questions on the subject: Computers and Technology
![image](/tpl/images/cats/informatica.png)
Computers and Technology, 23.06.2019 07:00, MissSmartyPants88
To produce a starlight effect in her photograph, lina should choose the filter for her camera.
Answers: 1
![image](/tpl/images/cats/informatica.png)
Computers and Technology, 23.06.2019 14:00, allison9746
Need ! will choose brainliest! discuss the role of abstraction in the history of computer software.
Answers: 1
![image](/tpl/images/cats/informatica.png)
Computers and Technology, 23.06.2019 17:00, chrisgaz14
The more powerful, 60 volt cables and the main power shut off on an hev are both colored orange
Answers: 1
You know the right answer?
Consider the task of writing a method named countfactors that accepts an integer (assumed to be posi...
Questions in other subjects:
![Konu](/tpl/images/cats/mat.png)
![Konu](/tpl/images/cats/mat.png)
![Konu](/tpl/images/cats/ekonomika.png)
![Konu](/tpl/images/cats/en.png)
English, 18.06.2020 02:57
![Konu](/tpl/images/cats/istoriya.png)
History, 18.06.2020 02:57
![Konu](/tpl/images/cats/mat.png)
Mathematics, 18.06.2020 02:57
![Konu](/tpl/images/cats/mat.png)
Mathematics, 18.06.2020 02:57
![Konu](/tpl/images/cats/mat.png)
![Konu](/tpl/images/cats/ekonomika.png)