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...
Type: Posts; User: Junky
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...
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.
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...
But your advice to hard code it to print five A chars is just plain wrong!
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.