You forgot a new line on line 10. EDIT: It's more than that, see AbstractionAnon's post below.
Also, you should use a better indentation style for your code. Additionally consider always using curly braces even when you only have one statement inside.
After line 10, you proceed to doing your inner for loop, regardless of whether or not z == a. So when z is 5, line 10 prints out
123456789
and then goes on to loop and print the dots.
You should use an else block for the code you want to execute when z == a is not true.
I strongly recommend you use a consistent, sensible indentation style in your code. That will make it much easier for you to see the flow of control through your code at a glance, and see where there might be a mistake in the logic.
Also, I'd advise using curly braces even when a block contains only a single line. That helps guard against introducing errors when modifying your code.
If that were my code, It would be formatted like this:
sorry for causing so much trouble for you guys.. I usually use curly braces. it's just that i want to try to see if there's any difference with and without braces. And for the line 10 thing? what kind of else statement should i put? I've been thinking of what exception I could make to stop "z" from printing dotted lines when "z==a"..