class ByTimes2
{
 public static void main(String[] args)
 {
  int i=2, j=1;
 
  while(i<10)
  {
   while(j<10)
   {
    System.out.println(i + " x " + j + " = " + i*j);
    j++;
   }

   i++;
  }
 }
}

 

 

반복문중첩으로 구구단 만드는데,

왜 j 저기서 선언하니까 2단 밖에 안나옴 ㅠㅠㅠ??????  (근데 j를 두번째 while문 앞에서 선언하면 9단까지 다 나옴)