Search:

Type: Posts; User: Junky

Search: Search took 0.11 seconds.

  1. Re: Spaces at the start of every other line in a for loop

    Jeebus!

    The only thing wrong with the code in the original post was getting the space to print at the start of every even line.

    I don't care what you think but any program that uses hard coded...
  2. Re: Spaces at the start of every other line in a for loop

    In the original post they probably made a mistake but if you look at the code both inner and outer loops iterate num number of times. So output is determined by the value the user inputs.
  3. Re: Spaces at the start of every other line in a for loop

    Because the whole point of the program is that the user can enter how many lines (and chars per line) they want displayed. That is what the num variable is for. If I enter 10 I should get 10 lines...
  4. Re: Spaces at the start of every other line in a for loop

    But your advice to hard code it to print five A chars is just plain wrong!
  5. Re: Spaces at the start of every other line in a for loop

    I'd have to disagree with both above posters!

    It appears that the space needs to be displayed on every even numbered line. Use the mod operator to work out if the current line is odd or even.
Results 1 to 5 of 5