ALLInterview.com :: Home Page KalAajKal.com
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
tip   SiteMap shows list of All Categories in this site.
Google
 
Categories  >>  Software  >>  Programming Languages  >>  C
 
 


 

 
 C interview questions  C Interview Questions
 C++ interview questions  C++ Interview Questions
 VC++ interview questions  VC++ Interview Questions
 Delphi interview questions  Delphi Interview Questions
 Programming Languages AllOther interview questions  Programming Languages AllOther Interview Questions
Question
to find the program of matrix multiplication using arrays
 Question Submitted By :: Nithya
I also faced this Question!!     Rank Answer Posted By  
 
  Re: to find the program of matrix multiplication using arrays
Answer
# 1
/* Program for matrix multiplication using 2D array    
9/20/08
	By:-
		 rohit.born2code@gamil.com   or
                 rohit_kamlakar@rediff.com

*/

#include<iostream.h>
#include<conio.h>
const size=10;
void main()
{
int a[size][size],b[size][size],c[size][size],n,m,i,j,k;
char v;
clrscr();
do
{
 m=n=3;
 cout<<"Enter a 3X3 matrix(1)\n";

 for(i=0;i<m;i++)
 {
	 for(j=0;j<n;j++)
	 {
	 cin>>a[i][j];
	 }
 }
 cout<<"Enter a 3X3 matrix(2)\n";

 for(i=0;i<m;i++)
 {
	 for(j=0;j<n;j++)
	 {
	 cin>>b[i][j];
	 }
 }

 for(i=0;i<m;i++)
 {
	 for(j=0;j<n;j++)
	 {
		c[i][j]=0 ;
		 for(k=0;k<n;k++)
		 {
		  c[i][j]=c[i][j]+(a[i][k]*b[k][j]);
		 }
	 }
  }

 cout<<"The product matrix is :"<<endl;

 for(i=0;i<m;i++)
 {
  cout<<endl;
	 for(j=0;j<n;j++)
	 {
		cout<<c[i][j]<<"\t";
	 }
 }
 cout<<"\nWanna do it again ? (y/n)";
 cin>>v;
 }
  while(v=='y'||v=='Y');
 getch();
}
 
Is This Answer Correct ?    4 Yes 0 No
Rohit V.kamlakar
 

 
 
 
Other C Interview Questions
 
  Question Asked @ Answers
 
two variables are added answer is stored on not for third variable how it is possible?  2
palindrome for strings and numbers----Can anybody do the prog? TCS5
write a c program to check weather a particluar bit is set or not? IBM2
Implement a function that returns the 5th element from the end in a singly linked list of integers in one pass. Microsoft2
how to find sum of digits in C? CTS8
WHAT IS MAXIMUM SIZE OF AN ARRAY IN C LANGUAGE? IBM4
give one ip, find out which contry Google4
What is the output of the following program #include<stdio.h> main() { int i=0; fork(); printf("%d",i++); fork(); printf("%d",i++); fork(); wait(); } ADITI2
How to add two numbers without using arithmetic operators? Sapient7
how to implement stack work as a queue?  2
C program to find frequency of each character in a text file?  1
Reverse the part of the number which is present from position i to j. Print the new number. eg: num=789876 i=2 j=5 778986  1
Main must be written as a.the first function in the program b.Second function in the program c.Last function in the program d.any where in the program TCS10
Program to write some contents into a file using file operations with proper error messages.  1
How to avoid structure padding in C? Tech-Mahindra4
What is the difference between null pointer and the void pointer?  2
write a program to swap Two numbers without using temp variable. HP16
can anyone please tell me wat is backlogs... i was looking for the job openings where i read this.. eligibility criteria minimum 70% in degree without backlogs. is that arrear.. if so is it standing arrear or history of arrears... please help me...  2
Identify the correct argument for the function call fflush () in ANSI C: A)stdout B)stdin C)stderr D)All the above Accenture2
Here is alphabets : abcdefgh 1) how to reverse. as hgfedcba 2) after reversal, how to group them in a pair hg fe dc ba.  1
 
For more C Interview Questions Click Here 
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us interview questions urls   External Links 
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com