can any body please tell me that how to take input size of a matrix in 2 d array an then print the table of it....
sample output
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
can any body please tell me that how to take input size of a matrix in 2 d array an then print the table of it....
sample output
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
Jump to PostYou should loop through its indices.
You should loop through its indices.
Let's say you enter the number 5. That means you need to print 5 rows and each row has 5 numbers. The first number on the row tells you how to show the numbers on that row, for example row 1 all the numbers are in sequence 1,2,3,4 and 5. Row 2 you print every other number, such as 2, 4, 6, 8, and 10.
You don't actually use an array or matrix to do this.
I think the simplest way to solve this problem is to use two nested loops
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.
You're trying to visit a URL that doesn't currently exist on the web. Most likely, a member posted a link a long time ago to a web page that has since been removed. It's also possible that there was a typo when posting the URL. We redirect you to this notice instead of stripping out the link to preserve the integrity of the post.