- WAP To find the factor of 8 and it's
Sum of factors using while loop
8=132, 4, 8
sum= 15.
Answers
Answered by
1
Answer(in python):
n = 8
i = 1
factors = []
while i <= n/2:
if n % i == 0:
factors.append(i)
i += 1
print("Factors of " + str(n) + " are:", factors)
print("Sum of Factors is:", sum(factors))
Similar questions