(adsbygoogle = window.adsbygoogle || []).push({ google_ad_client: "ca-pub-2960223314593660", enable_page_level_ads: true }); Program to find factors of a number - TecGlance

Header Ads

Program to find factors of a number


Program to find factors of a number


a=input("Enter the number : ")
print"The factors are : "
for i in range(1, a + 1):
         if a % i == 0:
               print(i)

OUTPUT :

Enter the number :  60
The factors are :
1
2
3
4
5
6
10
12
15
20
30
60

 

 

No comments

Powered by Blogger.