#define NROWS 5
#define NCOLS 5
int main(void)
{
int i,j, max, min, m, n, max_1, max_2;
float M[NROWS][NCOLS], Mt[NROWS][NCOLS];
char key_hit, More_ops;
//Input the sizes
printf("ROW size(1-5) : ");scanf("%d",&m);
printf("Column size(1-5): ");scanf("%d",&n);
//Size Check
while(m>NROWS || n>NCOLS)
{
printf("Please re-enter the sizes. \n");
printf("Row size(1-5) : ");scanf("%d", &m);
printf("Column size(1-5) : ");scanf("%d", &n);
}
//Input the Matrix Data
for(i=0; i
{
for(j=0; j
{
printf("M[%d][%d] = ", i,j);
scanf("%f", &M[i][j]);
}
}
//Print the Matrix Data
for(i=0; i
{
for(j=0; j
{
printf("%1.2f\t", M[i][j]);
}
printf("\n");
}
//Choices of matrix operations
printf("\n\nPlease choose an operation.");
printf("\n1. Display The matrix M.");
printf("\n2. Display The Matrix and its transpose.");
printf("\n3. Max and min Values of array.");
printf("\n4. End the program.");
printf("\nYour choice (1-4): ");
scanf(" %c", &key_hit);
do{
switch(key_hit)
{
case '1':
//Option 1. Display Matrix M
printf("M is = ");
for(i=0; i
{
for(j=0; j
{
printf("%.2f\t", M[i][j]);
}
printf("\n\t");
}
break;
// Transpose of Matrix M
case '2':
printf("M is = ");
for(i=0; i
{
for(j=0; j
{
printf("%.2f\t", M[i][j]);
}
printf("\n\t");
}
printf("\nM - Transpose is = ");
for(i=0; i
{
for(j=0; j
{
Mt[i][j] = M[j][i];
printf("%.2f\t", Mt[i][j]);
}
printf("\n\t\t\t");
}
break;
//Min and Max values of Columns
case '3':
printf("M is = ");
for(i=0; i
{
for(j=0; j
{
printf("%.2f\t", M[i][j]);
}
printf("\n\t");
}
printf("\nMax values");
for(i=0;i<>
{ max_1 = M[0][i];
for(j=0;j<>
{
if(max_1 <>
{
max_1 = M[j][i];
}
}
printf(" %i\t", max_1);
}
break;
}
while(key_hit != '4');
return 0;
}
(** Here is my issue I need help on how I can put a repetition in. For example I choose case 1,then case 1 executes then the user should have a choice to continue or not.
Below will be an image example
Extracted text: Please choose an operation. 1. Just display the matrix 2. Display the_matrix and its transpose 3. Find max value of each column 4. Exit Your choice (1 4) : 3 M is: 1.23 1.09 -5.60 7.60 3.42 -3.40 -0.40 5.00 1.11 3.40 11.00 2.30 Max value 2.30 7.60 5.00 11.00 More operation (Y/N) ? Y Please choose an operation. 1. Just display the matrix 2. Display the_matrix and its transpose 3. Find max value of each column Frit 4