finished matrix addition func
This commit is contained in:
parent
3cb11a08b6
commit
1e24179a42
54
main.c
54
main.c
|
@ -12,12 +12,12 @@ int main()
|
||||||
printf("\n\n 1. Hypotenuse calculator");
|
printf("\n\n 1. Hypotenuse calculator");
|
||||||
printf("\n 2. Quadratic formula calculator");
|
printf("\n 2. Quadratic formula calculator");
|
||||||
printf("\n 3. Area of a circle");
|
printf("\n 3. Area of a circle");
|
||||||
printf("\n 4. Build a matrix");
|
printf("\n 4. * Matrix determinant *");
|
||||||
printf("\n 5. Matrix determinant");
|
printf("\n 5. Matrix addition");
|
||||||
printf("\n 6. Matrix addition");
|
printf("\n 6. * Matrix multiplication *");
|
||||||
printf("\n 7. Matrix multiplication");
|
printf("\n 7. Scalar matrix multiplication");
|
||||||
printf("\n 8. Scalar matrix multiplication");
|
printf("\n\n * Stared entries are not fully programmed.");
|
||||||
printf("\n\n Enter your choice here:_____");
|
printf("\n Enter your choice here:_____");
|
||||||
printf("\033[D");
|
printf("\033[D");
|
||||||
printf("\033[D");
|
printf("\033[D");
|
||||||
printf("\033[D");
|
printf("\033[D");
|
||||||
|
@ -81,54 +81,32 @@ int main()
|
||||||
|
|
||||||
case 4:
|
case 4:
|
||||||
|
|
||||||
system("clear");
|
|
||||||
// printf("\n ~~ Build a matrix ~~\n\n");
|
|
||||||
// int numRows;
|
|
||||||
// int numColumns;
|
|
||||||
// printf("\nPlease enter the number of rows: ");
|
|
||||||
// scanf("%d", &numRows);
|
|
||||||
// printf("\nPlease enter the number of columns: ");
|
|
||||||
// scanf("%d", &numColumns);
|
|
||||||
// buildMatrix(numRows, numColumns);
|
|
||||||
|
|
||||||
break;
|
|
||||||
//TODO: replace this
|
|
||||||
|
|
||||||
case 5:
|
|
||||||
|
|
||||||
system("clear");
|
system("clear");
|
||||||
printf("\n ~~ Matrix determinant ~~\n\n");
|
printf("\n ~~ Matrix determinant ~~\n\n");
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 6:
|
case 5:
|
||||||
|
|
||||||
system("clear");
|
system("clear");
|
||||||
printf("\n ~~ Matrix addition ~~\n\n");
|
printf("\n ~~ Matrix addition ~~\n\n");
|
||||||
// int numRows;
|
|
||||||
// int numColumns;
|
|
||||||
// printf("\nPlease enter the number of rows: ");
|
|
||||||
// scanf("%d", &numRows);
|
|
||||||
// printf("\nPlease enter the number of columns: ");
|
|
||||||
// scanf("%d", &numColumns);
|
|
||||||
|
|
||||||
// printMatrix(numRows, numColumns, matrix1);
|
int Rows;
|
||||||
// printf("\n");
|
int Columns;
|
||||||
// printMatrix(numRows, numColumns, matrix2);
|
printf("\nPlease enter the number of rows: ");
|
||||||
// printf("\n");
|
scanf("%d", &Rows);
|
||||||
|
printf("\nPlease enter the number of columns: ");
|
||||||
// addMatrices(numRows, numColumns, matrix1, matrix2, sumMatrix);
|
scanf("%d", &Columns);
|
||||||
|
matrixAddition(Rows, Columns);
|
||||||
// printMatrix(numRows, numColumns, sumMatrix);
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case 7:
|
case 6:
|
||||||
|
|
||||||
system("clear");
|
system("clear");
|
||||||
printf("\n ~~ Matrix multiplication ~~\n\n");
|
printf("\n ~~ Matrix multiplication ~~\n\n");
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case 8:
|
case 7:
|
||||||
|
|
||||||
system("clear");
|
system("clear");
|
||||||
printf("\n ~~ Scalar matrix multiplication ~~\n\n");
|
printf("\n ~~ Scalar matrix multiplication ~~\n\n");
|
||||||
|
|
Loading…
Reference in a new issue