User Profile

Collapse

Profile Sidebar

Collapse
Ndifreke
Ndifreke
Last Activity: May 2 '18, 09:26 PM
Joined: Apr 30 '18
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • Ndifreke
    replied to algorithm
    in C
    This reply is very useful.Thank you and here is my second attempt
    Step 1:Initialize the counter to 0 (j=0)
    Step 2:counter is equal to j plus 1(j=j+1)
    Step 3:print the value of the counter (print j)
    Step 4:if counter is greater than 20 (if j>20)
    Step 5:stop
    Step 6:else if j is less than 20 (j<20)
    Step 7:Add 2 to the value of the counter (j=j+2)
    Step 8:print j
    Step 9:Repeat steps 4 to 9 until...
    See more | Go to post

    Leave a comment:


  • Ndifreke
    started a topic algorithm
    in C

    algorithm

    I have an assignment to write an algorithm to print the first 10 odd numbers and this is my attempt
    Initialize the first counter to 1 (i=1)
    Initialize the second counter to 0 (j=0)
    second counter is equal to second counter plus first counter(j=j+i)
    print the value of the second counter (print j)
    if second counter is greater than 10 (if j>10)
    stop
    else if j is less than 10 (j<10)
    Add 2...
    See more | Go to post
No activity results to display
Show More
Working...