Greetings. I am attempting to perform scalar multiplication with a 3x3 variable length array. Normally this is a simple task for me. Scalar multiplication is done by multiplying each element of a matrix by the same integer.The problem is that the 2nd and 3rd rows of my result matrix have garbage values. It's as if these elements are never assigned values. I have been backwards and forwards through the code but I don't see anything wrong. This is either a brain cramp on my part or a bug in the system. Below is the code and a sample run of the program. I'm hoping a fresh set of eyes will spot a mistake.Sample input and output:Enter # of rows: 3Enter # of cols: 3Enter data for input matrix:a[0][0]: 1a[0][1]: 1a[0][2]: 1a[1][0]: 1a[1][1]: 1a[1][2]: 1a[2][0]: 1a[2][1]: 1a[2][2]: 1Enter scalar multiplier: 2input matrix:1 1 1 1 1 1 1 1 1 result matrix:2 2 2 3260041952890 -1444937728-4275510Code:#include // functions for the input and display of 2D matricesvoid input( int rows, int cols, int a[rows][cols] );void display( int rows, int cols, int a[rows][cols] );#define MAX 10int main(void){ int a[MAX][MAX], b[MAX][MAX]; int rows, cols; int m; printf("Enter # of rows: "); scanf("%d", &rows); printf("Enter # of cols: "); scanf("%d", &cols); printf("\n"); printf("Enter data for input matrix:\n"); input( rows, cols, a); printf("\n"); printf("Enter scalar multiplier: "); scanf("%d", &m); printf("\n"); // Here is the nested loop where the multiplication is done for(int i = 0; i < rows; i++) { for(int j = 0; j < cols; j++) { b[i][j] = m * a[i][j]; } } printf("input matrix:\n"); display(rows, cols, a); printf("\n"); printf("result matrix:\n"); display(rows, cols, b); printf("\n"); return 0;}void input( int rows, int cols, int a[rows][cols] ){ for(int i = 0; i < rows; i++) { for(int j = 0; j < cols; j++) { printf("a[%d][%d]: ", i, j); scanf("%d", &a[i][j]); } }}void display( int rows, int cols, int a[rows][cols] ){ for(int i = 0; i < rows; i++) { for(int j = 0; j < cols; j++) { printf("%-3d", a[i][j]); } printf("\n"); }}