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
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 int countFactorsint n
for int i ; i n; i
if n i check if i is a factor of n
return i;
return ;
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
