21 - Write an algorithm and draw a flow chart to print ODD numbers between 1 to N. Value of N is to be Read from standard input (keyboard).

Write an algorithm and draw a flow chart to print ODD numbers between 1 to N. Value of N is to be Read from standard input (keyboard).


Algorithm:

Step 1: Start.
Step 2: Declare i = 1, num.
Step 3: Enter num.
Step 4: If (i <= num) then goto step 5 else goto step 7.
Step 5: Display i.
Step 6: i = i + 2, goto step 4.
Step 7: Stop.


Flowchart:





Post a Comment

0 Comments
* Please Don't Spam Here. All the Comments are Reviewed by Admin.