-moz-user-select:none; -webkit-user-select:none; -khtml-user-select:none; -ms-user-select:none; user-select:none;

Tuesday, 5 May 2015

Making a multiplication table

Hello and Asalam o Alikum. I have already discussed the concept of  "nested loops" in my blogs.

As you know that a loop within another loop is known as nested loop. The outer loop is normally used for rows and the inner loop is used for columns.

So,today I am here with a very interesting program. This program is about making a multiplication table using nested loops.

Below is the source code of this program.

Source code


Output

Program's logic

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

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

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

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

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

No comments:

Post a Comment