Quantcast
Channel: Programming Forums
Viewing all articles
Browse latest Browse all 51036

While Loop Multiplication 10 x 10 order ! I need HELP !

$
0
0
public class Shumezimi
{
public static void main(String [] args)
{
int rr=1;
int k=1;
while (rr<=10)
{
k=1 ;
while (k<=5)
{
System.out.print(rr+" * "+k+" = "+(rr*k)+"\t");
k++;
}
rr++;

}
}
}


This is an example of 5x10 and its displays good on console but when i make 10x10 it got disordered from 1 to 5 i want to show it good then i want a second table to show 6 to 10 or

1 * 1 =1 2 * 1 =1 3 * 1 =1 4 * 1 =1 5 * 1 =1
1 * 2 =1 2 * 2 =1 3 * 1 =1 4 * 1 =1 5 * 1 =1
1 * 3 =1 2 * 3 =1 3 * 1 =1 4 * 1 =1 5 * 1 =1
1 * 4 =1 2 * 4 =1 3 * 1 =1 4 * 1 =1 5 * 1 =1
1 * 5 =1 2 * 5 =1 3 * 1 =1 4 * 1 =1 5 * 1 =1
1 * 6 =1 2 * 6 =1 3 * 1 =1 4 * 1 =1 5 * 1 =1
1 * 7 =1 2 * 7 =1 3 * 1 =1 4 * 1 =1 5 * 1 =1
1 * 8 =1 2 * 8 =1 3 * 1 =1 4 * 1 =1 5 * 1 =1
1 * 9 =1 2 * 9 =1 3 * 1 =1 4 * 1 =1 5 * 1 =1
1 * 10 =1 2 * 10 =1 3 * 1 =1 4 * 1 =1 1 * 1 =1

1 * 1 =1 1 * 1 =1 1 * 1 =1 1 * 1 =1 1 * 1 =1
1 * 2 =1 1 * 2 =1 1 * 1 =1 1 * 1 =1 1 * 1 =1
1 * 3 =1 1 * 3 =1 1 * 1 =1 1 * 1 =1 1 * 1 =1
1 * 4 =1 1 * 4 =1 1 * 1 =1 1 * 1 =1 1 * 1 =1
1 * 5 =1 1 * 5 =1 1 * 1 =1 1 * 1 =1 1 * 1 =1
1 * 6 =1 1 * 6 =1 1 * 1 =1 1 * 1 =1 1 * 1 =1
1 * 7 =1 1 * 1 =1 1 * 1 =1 1 * 1 =1 1 * 1 =1
1 * 8 =1 1 * 1 =1 1 * 1 =1 1 * 1 =1 1 * 1 =1
1 * 9 =1 1 * 1 =1 1 * 1 =1 1 * 1 =1 1 * 1 =1
1 * 10 =1 1 * 1 =1 1 * 1 =1 1 * 1 =1 1 * 1 =1

Viewing all articles
Browse latest Browse all 51036

Trending Articles