answersLogoWhite

0

from:

http://local.wasp.uwa.edu.au/~pbourke/other/determinant/

/*

Recursive definition of determinate using expansion by minors.

*/

double Determinant(double **a,int n)

{

int i,j,j1,j2;

double det = 0;

double **m = NULL;

if (n < 1) { /* Error */

} else if (n j1)

continue;

m[i-1][j2] = a[i][j];

j2++;

}

}

det += pow(-1.0,1.0+j1+1.0) * a[0][j1] * Determinant(m,n-1);

for (i=0;i<n-1;i++)

free(m[i]);

free(m);

}

}

return(det);

}

//New Answer By Shaikh SOHIAL Hussain form Pakistan

#include<stdio.h>

#include<conio.h>

void main ()

{ clrscr();

int a[10][10],row,i=0,j=0,result,w,x,y,z;

printf("This Program made 4 solve matrix determintae\n");

scanf("%d",&row);

while(i<row)

{printf("\n");

for(j=0;j<row;j++)

{ printf("Enter the value of %d%d\n",i,j);

scanf("%d",&a[i][j]);

}

i++;

}

i=0;

while(i<row)

{ printf("\n");

j=0; while( j<row)

{printf("%d",a[i][j]);

printf(" ");printf(" ");

j++;}

i++;

}

if(row==2)

{

result=(a[0][0]*a[1][1])-(a[0][1]*a[1][0]);

printf("The answer is\t %d",result);

}

else if(row==3)

{ result=(a[0][0]*((a[1][1]*a[2][2])-(a[1][2]*a[2][1]))) - (a[0][1]*((a[1][0]*a[2][2])-(a[1][2]*a[2][0]))) + (a[0][2]*((a[1][0]*a[2][1])-(a[1][1]*a[2][0])));

printf("\nThe answer is \t %d",result);

}

else if(row==4)

{

w=a[0][0]*(a[1][1]*(a[2][2]*a[3][3]-a[2][3]*a[3][2])-a[1][2]*(a[2][1]*a[3][3]-a[2][3]*a[3][1])+a[1][3]*(a[2][1]*a[3][2]-a[2][2]*a[3][1]));

x=a[0][1]*(a[1][0]*(a[2][2]*a[3][3]-a[2][3]*a[3][2])-a[1][2]*(a[2][0]*a[3][3]-a[2][3]*a[3][0])+a[1][3]*(a[2][0]*a[3][2]-a[2][2]*a[3][0]));

y=a[0][2]*(a[1][0]*(a[2][1]*a[3][3]-a[2][3]*a[3][1])-a[1][1]*(a[2][0]*a[3][3]-a[2][3]*a[3][0])+a[1][3]*(a[2][0]*a[3][1]-a[2][1]*a[3][0]));

z=a[0][3]*(a[1][0]*(a[2][1]*a[3][2]-a[2][2]*a[3][1])-a[1][1]*(a[2][0]*a[3][2]-a[2][2]*a[3][0])+a[1][2]*(a[2][0]*a[3][1]-a[2][1]*a[3][0]));

result=w-x+y-z;

printf("\n The answer is \t %d", result);

}

else{ printf("Determinate Limit is 4*4 max\n");

getch();

}

User Avatar

Wiki User

14y ago

Still curious? Ask our experts.

Chat with our AI personalities

ReneRene
Change my mind. I dare you.
Chat with Rene
ProfessorProfessor
I will give you the most educated answer.
Chat with Professor
LaoLao
The path is yours to walk; I am only here to hold up a mirror.
Chat with Lao
More answers

You can find the answer of this questions from this link. Also, you can find the related answers to C Programming. http://study-for-exam.blogspot.com/2013/04/write-c-progrm-to-find-determinant-of.html#.UXiMc4Jbwxg"

User Avatar

Wiki User

11y ago
User Avatar

void main()

{

int

User Avatar

Wiki User

12y ago
User Avatar

Add your answer:

Earn +20 pts
Q: Calculate determinants of a nxn matrix in C programming?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

How do you write a C program to print the diagonal element of a NxN matrix?

#include&lt;stdio.h&gt; #include&lt;conio.h&gt; void main() { int a[3][3],b[3][3],c[3][3],r,c; for(r=0;r&lt;=3;r++) { for(c=0;c&lt;3;c++) { printf("\n enter the value="); scanf("%d%d",&amp;a[r][c],&amp;b[r][c]); } } printf("\n first matrix=\n"); for(r=0;r&lt;=3;r++) { for(c=0;c&lt;3;c++) { printf("%d\t",a[r][c]); } printf("\n"); } printf("\n scond matrix=\n"); for(r=0;r&lt;=3;r++) { for(c=0;c&lt;3;c++) {printf("%d\t",b[r][c]); } printf("\n"); } printf("\n sum of given matrix=\n"); for(r=0;r&lt;=3;r++) { for(c=0;c&lt;3;c++) { c[r][c]=a[r][c]+b[r][c]; printf("%d\t",c[r][c]); } printf("\n"); } getch(); }


What is analyze pedigrees to identify patterns of inheritance for common genetic disorders?

Look at the phenotypes given in the pedigree to work forwards and backwards and figure out the genotypes to the best of your abilities (they can't always be figured out, but they can usually be narrowed down). Common genetic disorders have several patterns of inheritance. They can be dominant/recessive and then X-linked or Y-linked or autosomal. If they are codominant then it will be very obvious as there will be three possible conditions: normal, diseased, and half-diseased half-normal. Let D=disease, N=no disease, and O=no allele on the chromosome at all. Autosomal is easier to identify. If D is recessive, the following rules can help identify the genotypes. If D is dominant, the above rules can be modified to apply again. Just think of N as the disease and D as the normal condition. DxN=half D, half N--&gt;DDxND DxN=all N--&gt;DDxNN NxN=quarter D, others N--&gt;NDxND NxN=all N--&gt;NNxNN or NNxND (Obviously) DxD--&gt;all D--&gt;DDxDD Sex-linked is more difficult. Know that if a male expresses something, no matter whether it is dominant or recessive, that is his genotype (N or D). Females are still double-letter (NN, ND, DD). Write down the possible phenotypes of the parents and offspring. Then figure out which genotypes work, and then you can determine if D or N is recessive/dominant.