• Post Reply Bookmark Topic Watch Topic
  • New Topic

How Multidimensional arrays work?  RSS feed

 
Hari Keshav
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Could anyone explain how the code below gives the following output


OUTPUT:

size = 1
size = 2
size = 3
size = 4
size = 2
size = 3
size = 3
size = 4
size = 5
size = 6
size = 7
 
Campbell Ritchie
Marshal
Posts: 56546
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch

I added code tags to your post. Always use them: doesn't it look better.
For that code you will have to go through the loop and do some arithmetic. The output has little to do with arrays and much to do with adding numbers together.
 
Henry Wong
author
Sheriff
Posts: 23295
125
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hari Keshav wrote:Could anyone explain how the code below gives the following output




Henry
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!