I have a project due for my C class tomorrow and part of it is creating a user defined matrix. The user will enter how many rows and how many columns the matrix has, as well as what numbers are minimum and maximum within the matrix. The numbers are random between the user defined numbers. After everything is input, the matrix is supposed to be displayed.
It compiles and runs, but doesn't do anything except display one random number.
This is what I have so far:
float GetUserInfo(){ //getting the user to define the size and values of the matrix
int nrows, ncol, min, max;
int matrix[50][50],i, j;
printf("Please enter the number of rows and columns for the matrix:\n");
printf("number of rows: ");
scanf("%d", &nrows);
printf("number of columns: ");
scanf("%d", &ncol);
printf("Now enter the min and max value:\n");
printf("min value: ");
scanf("%d", &min);
printf("max value: ");
scanf("%d", &max);
for(i=0;i<nrows;i++){
for(j=0;j<ncol;j++){
}
}
matrix[i][j]=rand();
printf("The matrix generated is:\n%d \t", matrix[i][j]);
return;
}