Write an algorithm to accept any number and display the factors of the number, also display the sum
of the square of the factors of the number.
Answers
Answer:
number = int(input("Please Enter any Number: "))
value = 1
print("Factors of a Given Number {0} are:".format(number))
while (value <= number):
if(number % value == 0):
print("{0}".format(value))
value = value + 1
Answer:
The algorithm is:
number = int(input("Please Enter any Number: "))
value = 1
print("Factors of a Given Number {0} are:".format(number))
while (value <= number):
if(number % value == 0):
print("{0}".format(value))
value = value + 1
Explanation:
algorithm to accept any number and display the factors of the number, also display the sum of the square of the factors of the number is as below:
number = int(input("Please Enter any Number: "))
value = 1
print("Factors of a Given Number {0} are:".format(number))
while (value <= number):
if(number % value == 0):
print("{0}".format(value))
value = value + 1
#SPJ3