$(document).ready(function() { $('pre code').each(function(i, block) { hljs.highlightBlock(block); }); });

Sunday, July 11, 2010

cofactor value of matrix

#include
#include
#include
int calculate(int);
int cofactor();
void main()
{
unsigned int m[25][25],t[24][25][25],c[25][25];
int i,j,p,q,x,y,or;
unsigned int value;
printf("Enter the order of the matrix:");
scanf("%d",&or);
printf("Enter the elements of the matrix:");
for(i=0;i for(j=0;j {
printf("\nEnter element[%d][%d]:",i+1,j+1);
scanf("%d",&m[i][j]);
}

if(or==0)
value=0;
else if(or==1)
value=m[0][0];
else if(or==2)
value+=calculate(0);
else
value+=cofactor();
printf("\nCofactor of the determinant is:");
for(i=0;i {
printf("\n|");
for(j=0;j printf("%d ",m[i][j]);
printf("|");
}
}

calculate(int docalctn)
{
if(docalctn==0)
return 0;
}

cofactor()
{
return 0;
}Cofa

2 comments:

  1. Are you sure the program calculates the cofactor? I run your program and its just print out the input matrix. Please re-check the function cofactor(). Thanks

    ReplyDelete
  2. Sorry buddy, but it's been long i had written thins program. And then I was away from this blog for long. Anyways, I'll recheck the source code and will let you know.

    ReplyDelete

Contact Me

Name

Email *

Message *