Question: Help with my c programming script This is what i must do. Below is my script #include float determinant(float a[3][3]); float *firstmatrix; float *secondmatrix; float

Help with my c programming script

This is what i must do.

Help with my c programming script This is what i must do.

Below is my script

#include

float determinant(float a[3][3]); float *firstmatrix; float *secondmatrix; float detyx[3][3] = {{float *,float * ,float *},{float *,float *,float *},{float *,float *,float *}} float dety[3][3] = {{float,float,float},{float,float,float},{float,float,float}} float detyz[3][3] = {{float,float,float},{float,float,float},{float,float,float}} float a,b,c,determ;

int main() { int A[3][3]; int B[3];

printf("Please enter the values of a1 a2 and a3 (# # #) "); scanf("%i %i %i",&A[0][0],&A[1][0],&A[2][0]); printf("Please enter the values of b1 b2 and b3 (# # #) "); scanf("%i %i %i",&A[0][1],&A[1][1],&A[2][1]); printf("Please enter the values of c1 c2 and c3 (# # #) "); scanf("%i %i %i",&A[0][2],&A[1][2],&A[2][2]);

printf("Please enter the values of d1 d2 and d3 "); scanf("%i %i %i",&B[0],B[1],B[2]);

firstmatrix = A; secondmatrix = B;

if(determiant(A)!=0) printf("Using cramers rule we get solution (%f %f %f) ",determ(a)/determ(firstmatrix),determ(b)/determ(firstmatrix),determ(c)/determ(firstmatrix)); else printf("Could not find answer to cramers rule because determinant is 0");

getchar(); return 0;

}

float detyx[3][3] = {{float,float,float},{float,float,float},{float,float,float}} { a ={{*secondmatrix,*(*firstmatrix +1),*(*firstmatrix+2)},{*secondmatrix+1,*(firstmatrix+1)+1,*(firstmatrix+1)+2},{*secondmatrix+2,*(firstmatrix+2)+1,*(firstmatrix+2)+2}}; return a;}

float dety[3][3] = {{float,float,float},{float,float,float},{float,float,float}} { b= {{*firstmatrix,*secondmatrix,*(*firstmatrix+2)],{*(*firstmatrix+1),*secondmatrix+1,*(firstmatrix+1)+2},{*(*firstmatrix+2),*secondmatrix+2,*(firstmatrix+2)+2)}}; return b;} }

float detyz[3][3] = {{float,float,float},{float,float,float},{float,float,float}}{ c={{firstmatrix,*(*firstmatrix+1),*secondmatrix}{*(firstmatrix+1),*(firstmatrix+1)+1,*secondmatrix+1}{*(firstmatrix+2),*(firstmatrix+2)+1,*secondmatrix+2}}; return c;}

float determinant(float a[3][3]) { determ=((*firstmatrix)*(*(firstmatrix+1)*(*(firstmatrix+2)+2)))-((*firstmatrix)*(*(firstmatrix+1)+2)*(*(firstmatrix+2)+1)),+(((*(*firstmatrix+1))*(*(firstmatrix+1)+2)*(*(firstmatrix+2)))-(*(*firstmatrix+1))*(*(firstmatrix+1))*(*(firstmatrix+2)+2)),+((*(*firstmatrix+2))*(*(firstmatrix+1))*(*(firstmatrix+2)+1))-((*(*firstmatrix+2))*(*(firstmatrix+1)+1)*(*(firstmatrix+2))); return determ;}

Create a script that will use Cramer's rule to find the Solutions of Ar-b for A a 3 x 3 matrix and B a 3x 1 matrix Conditions you need to use 1) 2) User defined functions that will return value and take arguments. Also, this script should use two dimensional pointer that will take care of the whole matrix Then the values ofx, y and can be found as follows: ai bi di a2 b2 d2 ai di C1 a2 d2 c2 a3 d3 C3 a1 bi Ci a2 62 C2 di bi C1 d2 b2 C2 , and z- a1 1 Ci d2 a3 b3 c3 C2 a2 b2 c2 ?? en.wikipedia.org/wiki/Cramer le ndicates the determinant

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!