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       Ask Questions on ANYTHING, that arise in your Daily Life at     FORUM9.COM
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
WRITE A PROGRAM IN C TO MULTIPLY TWO 2-D ARRAYS
 Question Submitted By :: Guest
I also faced this Question!!     Rank Answer Posted By  
 
  Re: WRITE A PROGRAM IN C TO MULTIPLY TWO 2-D ARRAYS
Answer
# 1
#include<conio.h>
#include<stdio.h>
  void main()
  {
    int a[2][2],b[2][2],c[2][2];//declare 3 array int type
    int i,j,k;
     
    for(i=0;i<2;i++)
        { 
     for(j=0;j<2;j++)
         { 
   }     scanf("%d",&a[i][j]);//inserting element in array a

} 
 for(i=0;i<2;i++)
        { 
     for(j=0;j<2;j++)
         { 
   }     scanf("%d",&b[i][j]);//inserting element in array b

}
for(i=0;i<2;i++)
        { 
     for(j=0;j<2;j++)
         {  
          for(k=;k<2;K++)
             { 
              c[i][j]+=a[i][k]*b[i][j];//multiply of a and b
              }
          }
     }

for(i=0;i<2;i++)
        { 
     for(j=0;j<2;j++)
         { 
        printf("%d",a[i][j]);//printing element of array c
        }
    } 
 }//main close
 
Is This Answer Correct ?    4 Yes 2 No
Shubham Singh
 
  Re: WRITE A PROGRAM IN C TO MULTIPLY TWO 2-D ARRAYS
Answer
# 2
#include<conio.h>
#include<stdio.h>
  void main()
  {
    int a[2][2],b[2][2],c[2][2];//declare 3 array int type
    int i,j,k;
     
    for(i=0;i<2;i++)
        { 
     for(j=0;j<2;j++)
         { 
   }     scanf("%d",&a[i][j]);//inserting element in array a

} 
 for(i=0;i<2;i++)
        { 
     for(j=0;j<2;j++)
         { 
   }     scanf("%d",&b[i][j]);//inserting element in array b

}
for(i=0;i<2;i++)
        { 
     for(j=0;j<2;j++)
         {  
          for(k=;k<2;K++)
             { 
              c[i][j]+=a[i][k]*b[i][j];//multiply of a and b
              }
          }
     }

for(i=0;i<2;i++)
        { 
     for(j=0;j<2;j++)
         { 
        printf("%d",a[i][j]);//printing element of array c
        }
    } 
 }
 
Is This Answer Correct ?    2 Yes 2 No
Abhradeep Chatterjee
 
 
 
  Re: WRITE A PROGRAM IN C TO MULTIPLY TWO 2-D ARRAYS
Answer
# 3
Shubham Singh's Code is Wrong. Please follow my code for 
output.
 
Is This Answer Correct ?    0 Yes 3 No
Abhradeep Chatterjee
 
  Re: WRITE A PROGRAM IN C TO MULTIPLY TWO 2-D ARRAYS
Answer
# 4
#include<stdio.h>
#include<conio.h>
main()
{
    int a[2][2],b[2][2],c[2][2],i,j,k;
  
    for(i=0;i<2;i++)
    { 
      for(j=0;j<2;j++)
      { 
        scanf("%d",&a[i][j]);
      }   
    } 
 
    for(i=0;i<2;i++)
    { 
         for(j=0;j<2;j++)
         { 
            scanf("%d",&b[i][j]);
         } 
    }
     for(i=0;i<2;i++)
     { 
         for(j=0;j<2;j++)
         {  
            
             
               c[i][j]=a[i][j]*b[i][j];
            
         }
     }

      for(i=0;i<2;i++)
      { 
         for(j=0;j<2;j++)
         { 
            printf("%d",c[i][j]);
         }
      } 
}
 
Is This Answer Correct ?    1 Yes 0 No
Akshay Sharma
 

 
 
 
Other C Interview Questions
 
  Question Asked @ Answers
 
4.weight conversion: Write a program that will read weight in pounds and convert it into grams.print both the original weight and the converted value.There are 454 grams in a pound.design and carry out a test plan for this program. Wipro1
#include <stdio.h> #define sqr(x) (x*x) int main() { int x=2; printf("value of x=%d",sqr(x+1)); } What is the value of x? Oracle13
What is meaning of "Void main" in C Language. TCS8
implement general tree using link list Wipro1
Unsigned char c; for ( c=0;c!=256;c++2) printf("%d",c); No. of times the loop is executed ? Mascot3
#define min((a),(b)) ((a)<(b))?(a):(b) main() { int i=0,a[20],*ptr; ptr=a; while(min(ptr++,&a[9])<&a[8]) i=i+1; printf("i=%d\n",i);}  3
how does the C compiler interpret the following two statements p=p+x; q=q+y; a.p=p+x; q=q+y b.p=p+xq=q+y c.p=p+xq; q=q+y d.p=p+x/q=q+y TCS3
What's wrong with the call "fopen ("c:\newdir\file.dat", "r")"?  1
Who had beaten up hooligan "CHAKULI" in his early college days?  1
What is an object?  3
Go through the following code sinippet char a[20]; a="Hello Orcale Test"; will this compile? Oracle3
Difference between Class and Struct. Motorola6
Would you rather wait for the results of a quicksort, a linear search, or a bubble sort on a 200000 element array? 1) Quicksort 2) Linear Search 3) Bubble Sort  2
what is object oriental programing?  1
What will be the output of x++ + ++x? MBT13
whether itis a structured language? Microsoft1
Write a program to find the given number is odd or even without using any loops(if,for,do,while)  2
write a programme that inputs a number by user and gives its multiplication table.  2
what are the general concepts of c and c++  1
c programming of binary addition of two binary numbers  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