(adsbygoogle = window.adsbygoogle || []).push({ google_ad_client: "ca-pub-2960223314593660", enable_page_level_ads: true }); Program to print even numbers between 1 to 10. - TecGlance

Header Ads

Program to print even numbers between 1 to 10.



Algorithm:
Step 1: Start

Step 2: Repeat steps 3,4&5 until num=10 reaches

Step 3: If num%2==0 goto step 4

Step 4: Print num

Step 5: Compute num=num+1

Step 6: Stop

Flowchart:

Program code:
for num in range(1,10):
    if num%2==0:
        print num
    num=num+1

No comments

Powered by Blogger.