Skip to content

Instantly share code, notes, and snippets.

@Codeplaza
Created December 13, 2013 14:17
Show Gist options
  • Save Codeplaza/7944913 to your computer and use it in GitHub Desktop.
Save Codeplaza/7944913 to your computer and use it in GitHub Desktop.
Quiz 5.0
#include <stdio.h>
#define R 4
#define C 4
void matrixModifier(int mat[][C])
{
mat++;
mat[1][1] = 300;
mat++;
mat[1][1] = 100;
}
void matrixPrinter(int mat[][C])
{
int i, j;
for (i = 0; i < R; i++)
{
for (j = 0; j < C; j++)
printf("%3d ", mat[i][j]);
printf("\n");
}
}
int main()
{
int mat[R][C] = { {13, 24, 33, 45},
{57, 65, 79, 87},
{93, 17, 10, 71},
{13, 49, 52, 61}
};
printf("Original Matrix \n");
matrixPrinter(mat);
matrixModifier(mat);
printf("Matrix after modification \n");
matrixPrinter(mat);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment