Hi there guys, im new to the forum.
Currently a first year programming student, and struggling on arrays as i missed a lecture. Here's what i need to do, and what ive done, before i hit my point of not knowing any more.
Im trying to write a program that will read this data into a 2 dimensional array (data is 1,2,3,4,5,6,7,8,9) so, i've used this
then ive usedCode:int arr[3][3]={ {1,2,3}, {4,5,6}, {7,8,9} };
to make the program produce the data into a nicely formatted arrayCode:int i,j; for (i=0;i<3;++i) { for(j=0;j<3;++j) printf("%d",arr[i][j]); printf("\n"); }
1 2 3
4 5 6
7 8 9
Which so far is correct, and working.
Now i need to have the add the value's within the columns, and have them output a lower total, and a side total. What i mean is,
Im stumped as to how i do this, and my text book only tells me so much, please, i hope you can help me!Code:1 2 3| 6 4 5 6| 15 7 8 9| 24 ========== 12 15 18
MANY THANKS,
Masschino![]()



LinkBack URL
About LinkBacks




. Invalid indirection apparently.