(adsbygoogle = window.adsbygoogle || []).push({ google_ad_client: "ca-pub-2960223314593660", enable_page_level_ads: true }); Program to print all the natural numbers from 1 to n - TecGlance

Header Ads

Program to print all the natural numbers from 1 to n


Program to print all the natural numbers from 1 to n


a=input("Enter the number up to which to be printed : ")

n=0

for a in range(1,a+1):

    print a

    if n==a:

        break

 OUTPUT :

Enter the number up to which to be printed : 10

1
2
3
4
5
6
7
8
9
10

   

No comments

Powered by Blogger.