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

Header Ads

Program to print odd numbers between 1 to 100.


Algorithm:
Step 1: Start
Step 2: Assign i=0
Step 3: Repeat steps 4,5&6 until i=100 reaches
Step 4: if i%2!=0 goto step 5
Step 5: Print i
Step 6: Compute i=i+1
Step 7: Stop

Flowchart:

Program code:
i=0
while i<100:
    if i%2!=0:
        print i
    i=i+1

2 comments:

Powered by Blogger.