code

1 2 3 4 5
2 4 6 8 10
3 6 9 12 15
4 8 12 16 20
5 10 15 20 25

Help Sir.. what is the code this problem ?
Hi,

this is simply the multiple of integers of 5 upto 5

you can achieve this by using nested loops

http://www.cplusplus.com/doc/tutorial/control/

try to code and ask freely if you have a problem

a similar thread you may like : http://www.cplusplus.com/forum/general/202713/
Last edited on
i have no idea Sir , please show me the code .
This should do it:
 
cout << "1 2 3 4 5\n2 4 6 8 10\n3 6 9 12 15\n4 8 12 16 20\n5 10 15 20 25\n";
More seriously, approach the problem step by step. Try to write code to generate just the first line.
1 2 3 4 5
Use a for loop to do that. Post your attempt at that here if it gives you trouble, and someone will help where necessary

After that, consider a second for loop which will generate just the first column.
1
2
3
4
5
Hint, it will look very similar to the first, except for a newline.
Again, if that gives you trouble, post your attempt here and someone will try to help.

The final step is to combine the two. But don't worry about that till later.

You can learn about loops in the tutorial here:
http://www.cplusplus.com/doc/tutorial/control/
Last edited on
Topic archived. No new replies allowed.