Questions

Q:

Write a program for matrix multiplication in c

Answer

#include <stdio.h>


int main() {


  int a[5][5], b[5][5], c[5][5], i, j, k, sum = 0, m, n, o, p;


  printf( "\nEnter the row and column of first matrix" );


  scanf( "%d %d", &m, &n );


  printf( "\nEnter the row and column of second matrix" );


  scanf( "%d %d", &o, &p );


  if(n!=o) {


      printf( "Matrix mutiplication is not possible" );


      printf( "\nColumn of first matrix must be same as row of second matrix" );


  }


  else {


      printf( "\nEnter the First matrix" );


      for( i=0; i<m; i++ )


      for( j=0; j<n; j++ )


           scanf( "%d", &a[i][j] );


      printf( "\nEnter the Second matrix" );


      for( i=0; i<o; i++ )


      for( j=0; j<p; j++ )


           scanf( "%d", &b[i][j] );


      printf( "\nThe First matrix is\n" );


      for( i=0; i<m; i++ ) {


      printf("\n");


      for( j=0; j<n; j++ ) {


           printf( "%d\t", a[i][j] );


      }


      }


      printf( "\nThe Second matrix is\n" );


      for( i=0; i<o; i++ ) {


      printf("\n");


      for( j=0; j<p; j++ ) {


           printf( "%d\t", b[i][j] );


      }       


      }


      for( i=0; i<m; i++ )


      for( j=0; j<p;j++ )


           c[i][j] = 0;


      for( i=0; i<m; i++ ) { //row of first matrix


      for( j=0; j<p; j++ )  {  //column of second matrix


           sum = 0;


           for( k=0; k<n; k++ )


               sum = sum + a[i][k]*b[k][j];


           c[i][j] = sum;


      }


      }


  }


  printf( "\nThe multiplication of two matrix is\n" );


  for( i=0; i<m; i++ ) {


      printf("\n");


      for( j=0; j<p; j++ ) {


           printf( "%d\t", c[i][j] );


      }


  }


  return 0;


}

Report Error

View answer Workspace Report Error Discuss

Subject: Programming

0 2373
Q:

What is fingerprint powder made of?

A) Rosin B) Black ferric oxide
C) Lamp black D) All of the above
 
Answer & Explanation Answer: D) All of the above

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: General Science
Exam Prep: AIEEE , Bank Exams , CAT
Job Role: Bank Clerk , Bank PO

1 2373
Q:

Which railway station became the first of South Central Railway zone to hoist a tricolour flag (100ft)?

A) Secunderabad B) Chennai
C) Bengaluru D) Panaji
 
Answer & Explanation Answer: A) Secunderabad

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: General Awareness
Exam Prep: AIEEE , Bank Exams , CAT
Job Role: Analyst , Bank Clerk , Bank PO

1 2373
Q:

Which dynasty was responsible for the Mahabalipuram monuments near Chennai?

Answer

Pallava

Report Error

View answer Workspace Report Error Discuss

Subject: World History

2 2372
Q:

The bar graph shows the number of employees working in the different departments of a company. Study the diagram and answer the following questions

Which department has the lowest number of employees?

A) C B) D
C) A D) B
 
Answer & Explanation Answer: B) D

Explanation:
Report Error

View Answer Report Error Discuss

1 2372
Q:

What has feet and legs and nothing else?

Answer

Stocking is long sock that women wore which has legs and feet and nothing else.

Report Error

View answer Workspace Report Error Discuss

Subject: Word Puzzles Exam Prep: GRE , Bank Exams , AIEEE
Job Role: Bank PO , Bank Clerk , Analyst

1 2372
Q:

In the following question, out of the four alternatives, select the alternative which will improve the bracketed part of the sentence. In case no improvement is needed, select "no improvement". 
 
she thought she (have rediscovered) her real self after a long time

A) had rediscovered B) Had rediscover
C) had rediscovering D) no improvement
 
Answer & Explanation Answer: A) had rediscovered

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: English
Exam Prep: Bank Exams
Job Role: Bank PO , Bank Clerk

0 2371
Q:

In India, some of the Fundamental Rights can be suspended during of

A) Festivals B) Elections
C) Wars D) Floods
 
Answer & Explanation Answer: C) Wars

Explanation:

During any emergency of wars, some of the Fundamental Rights can be suspended that is what mentioned in constitution of India.

Report Error

View Answer Report Error Discuss

Filed Under: Indian Politics
Exam Prep: AIEEE , Bank Exams , CAT
Job Role: Analyst , Bank Clerk , Bank PO

7 2370