Multiplication Table using do while loop


The do statement first evaluate the body of the loop  and At the end of the loop, the test condition int the while statement is evaluated.
 The program continues till the condition is true and again evaluate the loop .

class dowhile
{
public static void main(String aa[])
{
int row,col,y;
System.out.println("multiplication table");
row=1;
do                                  
{
col=1;
do
{
y=row*col;
System.out.print(" "+y);
col=col+1;
}
while(col<=5);
System.out.println("\n");
row=row+1;
}
while(row<=5);
}}

Output ....

Multiplication Table

About Us

Rekha SetiaRekha Setia is a passionate blogger of Extra Computer Notes. if you have any ideas or any request me @