Hi guys! There was a question on an old lab test that I got incorrect, and I was wondering if someone could clear it up for me?
int i=0;
do {
int j =1;
do {
System.out.print("a");
j++;
}
while(j < i);
System.out.println();
i++;
}
while (i < 5);
The answer is:
a
a
a
aa
aaa
So, I understand what it's asking and how it's supposed to work, except I'm having trouble with the while(j<i). Isn't j ALWAYS greater than i, since i=0 was stated in the beginning?
Scorks