Created
December 13, 2013 14:17
-
-
Save Codeplaza/7944913 to your computer and use it in GitHub Desktop.
Quiz 5.0
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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