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();
}
Chat with our AI personalities
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"
#include<stdio.h> #include<conio.h> void main() { int a[3][3],b[3][3],c[3][3],r,c; for(r=0;r<=3;r++) { for(c=0;c<3;c++) { printf("\n enter the value="); scanf("%d%d",&a[r][c],&b[r][c]); } } printf("\n first matrix=\n"); for(r=0;r<=3;r++) { for(c=0;c<3;c++) { printf("%d\t",a[r][c]); } printf("\n"); } printf("\n scond matrix=\n"); for(r=0;r<=3;r++) { for(c=0;c<3;c++) {printf("%d\t",b[r][c]); } printf("\n"); } printf("\n sum of given matrix=\n"); for(r=0;r<=3;r++) { for(c=0;c<3;c++) { c[r][c]=a[r][c]+b[r][c]; printf("%d\t",c[r][c]); } printf("\n"); } getch(); }
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-->DDxND DxN=all N-->DDxNN NxN=quarter D, others N-->NDxND NxN=all N-->NNxNN or NNxND (Obviously) DxD-->all D-->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.