Monday, May 24, 2010

C programming?

how do i create a 19X19 two dimensional array in C? and how do i set the values of any of the points equal to either 1, 2, or 3?

C programming?
int array[19][19];


int i;


int j;


int value;





value = 0; // value goes from 0 to 2


for(i = 0; i %26lt; 20; i++)


for(j = 0; j %26lt; 20; j++)


{


array[i][j] = value + 1; // add 1 to go from 1 to 3


value = (value +1) % 3; // get next value


}

crab apple

No comments:

Post a Comment