c++ program to display odd number up to 21

c++ program to display odd number

Program

Method 1
c++ program to display odd number up to 21 using for loop


Method 2
c++ program to display odd number up to 21 using while loop


Method 3
c++ program to display odd number up to 21 using do while loop



Output:-
1
3
5
7
9
11
13
15
17
19
21

8 Comments

  1. First of all I would like to say thanks for sharing such nice Article. I will be glad to read a such nice post. It's really so Informational and I learn much from them. Keep posting.

    With Regards,
    http://stdiocorps.com/

    ReplyDelete
    Replies
    1. Hey,can i ask u a question.. Can uh tell me after finding odd numbers how can i increment these odd numbers??

      Delete
  2. Can i ask something how can we increment these odd numbers??

    ReplyDelete
  3. in this output we have 1 to 21 odd numbers but in while condition we are putting i<=20 but in output we have 21 which is greater then 20.. Please help me out

    ReplyDelete

Add your comments here

Back to Top