Quantcast
Channel: Programming Forums
Viewing all articles
Browse latest Browse all 51036

Nested for loops

$
0
0
Hi there,

Trying to convert a program from python to java and i have to create and fill a 2 dimensional array with 0's.
I decided that using nested for loops should be the easiest way, but for some reason its not working.
The problem lies in this segment of code:

int [][] board = new int [10][10];

for (int i=0; i<=9; i++)

	{for (int k=0; k<=9; k++)
		{board[i][k] = 0;
		}
	}

Viewing all articles
Browse latest Browse all 51036

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>