#include #include #include #define SIZE 10000 void sum_array1(int* a, long n){ long i,j; long sum = 0; for (i = 0; i < n; i++){ for (j =0; j < n; j++){ sum += a[i*SIZE + j]; } } } void sum_array2(int* a, long n){ long i,j; long sum = 0; for (j = 0; j < n; j++){ for (i =0; i < n; i++){ sum += a[i*SIZE + j]; } } } int main(){ int *a = (int *) calloc(SIZE*SIZE, sizeof(int)); memset(a,1,SIZE*SIZE); printf("Start\n"); sum_array1(a,SIZE); printf("End done phase 1\n"); sum_array2(a,SIZE); printf("End part 2\n"); }