Answer:
Instead of return i in the if you should store i in an array or print i.
Step-by-step explanation:
In the code there is written return i.As the compiler encounter the return statement the execution of the function stops it returns the value that i.That we don't want to do.This code will return only 1 factor that is 1.You can either print the factor for that inn the if statement instead of return print the values of i.Since the function is of integer type return 0 in the end or you can create an array and an integer with initial value 0 and insert all i's in if statement in the array.