Answer:
Following are the program for the above question:
Explanation:
#include <stdio.h> //header file
void inputMatrix(int matrixA[3][3]) //inputmatrix function to take the inputs and display the outputs.
{
int i,j; //declare the symbols.
//loop to take the inputs.
for(i=0;i<3;i++)
for(j=0;j<3;j++)
scanf("%d",&matrixA[i][j]);
//loop to print the output
for(i=0;i<3;i++)
{
for(j=0;j<3;j++)
printf("%2d",matrixA[i][j]);
printf("\t");
}
}
int main() //main function
{
int matrixA[3][3]; //matrix declaration.
inputMatrix(matrixA); //calling function.
return 0;
}
Output:
Code Explanation: