This is what I have so far but I need help figuring out how to print the matrix from the function!!!
Code:
#include <stdio.h>
#include <stdlib.h>
int main()
{
int choice;
do
{
printf("____Menu____\n");
printf("1: Create Augmented Matrix\n");
printf("2: Print Current Augmented Matrix\n");
printf("2: Solve Augmented Matrix\n");
printf("3: See Solution Matrix\n");
printf("5: Exit\n");
scanf("%d", &choice);
switch(choice)
{
case 1: cmat();
break;
case 2: printmat();
break;
case 3: solvemat();
break;
case 4: solutionmat();
break;
case 5: printf("Quitting program!\n");
break;
default: printf("Invalid choice!\n");
break;
}
} while (choice !=3);
}
void cmat(void)
{
int i,j,n;
float A[20][20];
printf("\nEnter the order of matrix: ");
scanf("%d",&n);
printf("\nEnter the elements of augmented matrix:\n\n");
free(A);
for(i=1; i<=n; i++)
{
for(j=1; j<=(n+1); j++)
{
printf("A[%d][%d] : ", i,j);
scanf("%f",&A[i][j]);
}
}
}
void printmat(void)
{
}