Algorithm:
Step 1: Start
Step 2: Read a number, num
Step 3: Repeat steps4,5&6 until i=num reach
Step 4: if num%i==0 then goto step 5
Step 5: Print i
Step 6: Compute i=i+1
Step 7: Stop
Flowchart:
Program code:
i=1
num=int(input('Enter a number '))
while i<=num:
if num%i==0:
print i
i=i+1
No comments