Doing while(j<=1) gives me an infinite amount of astriks, and the program is supposed to do caps at 6. I'm still not getting the right input. Normally I would just do a for loop, but I'm required to do a while loop.
I just tried my instructions while on an actual computer. Works for me.
One thing I forgot was, don't print a newline after every *. Just print one after each row (inner loop).
If you're getting an infinite loop, perhaps you modified the outer loop instead of the inner loop. Since this code is relatively simple, try going through it by hand for n = 3 instead of 6.