Respuesta :
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:
- The above code take the 9 inputs from the user and display the output as described question format.
Code Explanation:
- There is one user-defined function that takes the double dimension array as the argument.
- Then it takes the 9 value for the double dimension array.
- Then it displays the value to the user in that format which is defined by the question.