I need to create 2 loops going from 1 to 10, just one inside another.
WORKS
- Using for and for.
- Using while and for.
Why does not it work?
1) WHILE AND WHILE
int a=1, b=1;
while(a<=10) {
while(b<=10) {
System.out.print(a + "-" + b + " ");
b++;
} //fim while b
System.out.println("");
a++;
}//fim while a
2) FOR AND WHILE
int b=1;
for(int a=1; a<=10; a++) {
while(b<=10) {
System.out.print(a + "-" + b + " ");
b++;
}// fim while b
}// fim for a