JavaScript is required to use Bungie.net

Forums

9/14/2013 7:28:07 AM
1
Add an if condition for the for loop and endl output that checks if counter is odd. If(counter%2) Do not include counter-- in if block As for the descending part, before running the while loop, decrement counter by 1 otherwise you will get two lines of seven *. In the while loop, use counter>0, then add the if statement to check for odd number. Then. In the for loop use x=counter-1;x>=0;x-- What you r currently doing in the for loop is assignong value 0 to x then decrementing it on every iteration and checking if it is greater than a positive num which will never happen, thus resulting in an infinite loop..
English

Posting in language:

 

Play nice. Take a minute to review our Code of Conduct before submitting your post. Cancel Edit Create Fireteam Post

  • [spoiler]The if condition will currently give you even numbers. To get odd numbers you just append something to the existing statement. I'll let you figure that out yourself..[/spoiler]

    Posting in language:

     

    Play nice. Take a minute to review our Code of Conduct before submitting your post. Cancel Edit Create Fireteam Post

You are not allowed to view this content.
;
preload icon
preload icon
preload icon