Storing and printing an array table
This is what I'm supposed to store as an array:
Quote:
236.41 382.01 529.51
959.50 300.18 946.60
362.72 250.97 950.26
3.42 65.28 789.10
165.89 735.90 187.78
944.83 995.58 412.90
894.48 183.67 787.93
47.86 933.07 667.66
851.40 138.38 680.80
764.23 266.32 24.34
So the code I currently have is:
Code:
#include <stdio.h>
int main(void)
{
int i;
double arraysums [10] [3] = { {236.41, 382.01, 529.51},
{959.50, 300.18, 946.60},
{362.72, 250.97, 950.26},
{ 3.42, 65.28, 789.10},
{165.89, 735.90, 187.78},
{944.83, 995.58, 412.90},
{894.48, 183.67, 787.93},
{ 47.86, 933.07, 667.66},
{851.40, 138.38, 680.80},
{764.23, 266.32, 24.34}};
printf("%d", arraysums[10][3]);
}
This is not printing at all. I've specified which rows and columns to print, and I believe I've correctly stored the numbers in an array.
After I get it printed i'm supposed to add all the numbers in each individual column and see which column I'm sure I can achieve this by using:
Code:
for (i=0; i<11; i++);
sum = sum + arraysums [i][1];
But I'm not sure. This problem is killing me. XD