#Write a program that reads a positive integer. The program finds and #prints the sum of all divisors of the input number. #example: n=12, n%1=12%1=0, 1 is a divisor of 12 #12%2=0, 2 is a divisor of 12 #12%3=0, 3 is a divisor of 12 #12%4=0, 4 is a divisor of 12 #12%5=2, 5 is NOT a divisor of 12 #12%6=0, 6 is a divisor #12%7=5, 7 is NOT a divisor of 12 #12%8=4, 8 is NOT a divisor of 12 #12%9=3, 9 is NOT a divisor of 12 #12%10=2, 10 is NOT a divisor of 12 #12%11=1, 11 is NOT a divisor of 12 #12%12=0, 12 is a divisor of 12 n=int(input("enter positive integer ")) if(n>0): i=1 #in this example we must start from 1 to avoid division by 0 sum=0 while(i<=n): if(n%i==0): print(i,"is a divisor of",n) sum=sum+i i=i+1 print("sum=",sum) else: print("invalid input")