Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


write a program in c language that is able to compute the
determinant of any 5*5 matrix from your program with at
least five examples and print the result



write a program in c language that is able to compute the determinant of any 5*5 matrix from your..

Answer / vasanthi

#include<conio.h>
#include<stdio.h>

int a[20][20],m;
int determinant(int f[20][20],int a);
int main()
{
int i,j;
printf("----------------------------------------------------------------------\n");
printf("-------------------made by C code champ ------------------------------\n");
printf("----------------------------------------------------------------------\n");
printf("\n\nEnter order of matrix : ");
scanf("%d",&m);
printf("\nEnter the elements of matrix\n");
for(i=1;i<=m;i++)
{
for(j=1;j<=m;j++)
{
printf("a[%d][%d] = ",i,j);
scanf("%d",&a[i][j]);
}
}
printf("\n\n---------- Matrix A is --------------\n");
for(i=1;i<=m;i++)
{
printf("\n");
for(j=1;j<=m;j++)
{
printf("\t%d \t",a[i][j]);
}
}
printf("\n \n");
printf("\n Determinant of Matrix A is %d .",determinant(a,m));
getch();
}

int determinant(int f[20][20],int x)
{
int pr,c[20],d=0,b[20][20],j,p,q,t;
if(x==2)
{
d=0;
d=(f[1][1]*f[2][2])-(f[1][2]*f[2][1]);
return(d);
}
else
{
for(j=1;j<=x;j++)
{
int r=1,s=1;
for(p=1;p<=x;p++)
{
for(q=1;q<=x;q++)
{
if(p!=1&&q!=j)
{
b[r][s]=f[p][q];
s++;
if(s>x-1)
{
r++;
s=1;
}
}
}
}
for(t=1,pr=1;t<=(1+j);t++)
pr=(-1)*pr;
c[j]=pr*determinant(b,x-1);
}
for(j=1,d=0;j<=x;j++)
{
d=d+(f[1][j]*c[j]);
}
return(d);
}
}

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Sciences AllOther Interview Questions

describe a difficult customer or co worker you have experienced in the past and how you dealt with him/her?

0 Answers   Royal Lancaster Hotel,


who is the winner of woman's single title in french open tennis championship 2011

0 Answers  


What form of energy goes into a hydroelectric energy station? What comes out?

0 Answers  


Assuming that the constitution parameters of aluminum are given by &#956;=&#956;&#1770;o=4&#928;x10^(-7)N/A^2 and &#963;=3.54x10^7mho/m,find the frequency for which the skin depth in aluminum is 0.01 mm.

0 Answers  


how to make RIAD hard disk in windows xp 2? how to make Hard Disk mirror with DELL model 755?

0 Answers   Microsoft,


what is black hole.

1 Answers  


where is plural executive exists in ?

0 Answers  


what is buffering

0 Answers  


is it possible that the all water IN WORLD will be LOST???

0 Answers  


How is concentration of surfactant is chosen for the dissolution media in dissolution development ?

0 Answers   Mylan,


what are essential components of digital computer? discuss the function of each components. draw the block diagram of a computer showing its essential components

0 Answers  


who discovered the groups of blood?

0 Answers  


Categories