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 2329
Q:

Pick up the most effective word from the given words to fill in the blanks to make the sentence meaningfully complete.

The villagers ______ the murder of their leader by burning the police van.

A) Protested B) Avenged
C) Mourned D) Consoled
 
Answer & Explanation Answer: A) Protested

Explanation:

Protested is used because here the villagers express their feeling by making an objection to what has been done.

Report Error

View Answer Report Error Discuss

Filed Under: English
Exam Prep: Bank Exams

0 2328
Q:

What element behaves most like magnesium?

A) Sr B) S
C) Si D) Sn
 
Answer & Explanation Answer: A) Sr

Explanation:

We know that, elements in the same group of the periodic table have similar characteristics. Here magnesium and strontium are the same 2nd group elements and have same behavior. 

Therefore, strontium behaves same as magnesium. 

Report Error

View Answer Report Error Discuss

Filed Under: Chemistry
Exam Prep: AIEEE , Bank Exams , CAT , GATE
Job Role: Analyst , Bank Clerk , Bank PO

5 2328
Q:

Which of the following represents a positive economic statement?

A) The government should extend unemployment benefits. B) The unemployment rate is too high.
C) Taxes should not be increased since that will lower spending. D) The unemployment rate is 4.8 percent.
 
Answer & Explanation Answer: D) The unemployment rate is 4.8 percent.

Explanation:
Report Error

View Answer Report Error Discuss

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

2 2327
Q:

The playback singer who is certified as the 'Most Recorded Artist' in the world (2009) by the World Records Academy is ________

Answer

Asha Bhosle . She  is the sister of Latha Mangeshkar

Report Error

View answer Workspace Report Error Discuss

0 2327
Q:

The reverse effect of X-ray emission is

A) Raman effect B) Compton effect
C) Zeeman effect D) Photo-electric effect
 
Answer & Explanation Answer: D) Photo-electric effect

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: Physics
Exam Prep: Bank Exams

2 2327
Q:

Evergreen trees lose their leaves steadily all year.

A) TRUE B) FALSE
Answer & Explanation Answer: A) TRUE

Explanation:

Trees that lose all of their leaves for part of the year are known as deciduous trees. Those that don't are called evergreen trees.

Report Error

View Answer Workspace Report Error Discuss

Subject: General Science
Exam Prep: AIEEE , Bank Exams
Job Role: Analyst , Bank Clerk

1 2326
Q:

Who is the author of the book ' The Last Word'

Answer

Hanif Qureishi

Report Error

View answer Workspace Report Error Discuss

2 2326