| PREV |
Programs |
NEXT |
| |
(57 / 301) |
|
|
|
|
Write a C program to multiply two matrices.
|
Are you sure you know this? A lot of people think they already know this, but guess what? So take a good look at this C program. Its asked in most of the interviews as a warm up question.
// Matrix A (m*n)
// Matrix B (n*k)
// Matrix C (m*k)
for(i=0; i<m; i++)
{
for(j=0;j<k;j++)
{
c[i][j]=0;
for(l=0;l<n;l++)
c[i][j] += a[i][l] * b[l][j];
}
}
|
| PREV |
COMMENTS INDEX PRINT |
NEXT |
Last updated:
November 3, 2005
www.cracktheinterview.com - Your destination for the most common IT interview questions, answers, frequently asked interview questions (FAQ), C Programs, C Datastructures for technical interviews conducted by the top IT companies around the world!
|
|
|