#include #include #include int main(int argc, char **argv) { int n; int i, j, k; if(argc != 2) { fprintf(stderr,"Usage: %s matrix size\n", argv[0]); exit(EXIT_FAILURE); } n = atoi(argv[1]); if ( n > 0) { printf("Matrix size is %d\n",n); } else { fprintf(stderr,"Error, matrix size is %d \n", n); exit(EXIT_FAILURE); } double (*a)[n] = malloc(sizeof(double[n][n])); double (*b)[n] = malloc(sizeof(double[n][n])); double (*c)[n] = malloc(sizeof(double[n][n])); if ( a == NULL || b == NULL || c == NULL) { fprintf(stderr, "Not enough memory!\n"); exit(EXIT_FAILURE); } for (i=0; i