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

Which of the following is UN special agency and not programme

A) UNDP B) UNIFEM
C) IBRD D) UNFPA
 
Answer & Explanation Answer: A) UNDP

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: World Organisations

3 2351
Q:

When the employer receives an OSHA citation, it must be

A) Posted for 3 days or until the violation is fixed. B) Signed and returned to OSHA.
C) Copied and mailed to each worker. D) Contested and filed with the courts.
 
Answer & Explanation Answer: A) Posted for 3 days or until the violation is fixed.

Explanation:

OSHA's mission is to protect the safety and health of America's workers. When the employer receives an OSHA citation, it must be posted for 3 days or until the violation is fixed.

Report Error

View Answer Report Error Discuss

Filed Under: World Organisations
Exam Prep: AIEEE , Bank Exams , CAT
Job Role: Analyst , Bank Clerk , Bank PO

1 2351
Q:

Process of gaining electrons is known as _____.

A) oxidation B) reduction
C) radiation D) both oxidation and reduction
 
Answer & Explanation Answer: B) reduction

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: Chemistry
Exam Prep: Bank Exams

0 2351
Q:

Select the antonym of
to comprise

A) to dispute B) to embody
C) to span D) to encompass
 
Answer & Explanation Answer: A) to dispute

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: English
Exam Prep: Bank Exams

0 2351
Q:

Improve the bracketed part of the sentence.
The workers are bent (on) getting a full months pay as bonus.

A) for B) upon
C) to D) no improvement
 
Answer & Explanation Answer: B) upon

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: English
Exam Prep: Bank Exams

0 2350
Q:

In Frankenstein, Victor changes from an optimistic, eager young man to one who is anxious and

A) Remorseful B) Confident
C) Honest D) Coward
 
Answer & Explanation Answer: A) Remorseful

Explanation:

Frankenstein is an English Novel by Mary Shelley. In Frankenstein, Victor is a character who changes from an optimistic, eager young man to one who is anxious and Remorseful.

Report Error

View Answer Report Error Discuss

Filed Under: Books and Authors
Exam Prep: AIEEE , Bank Exams , CAT
Job Role: Analyst , Bank Clerk , Bank PO

2 2350
Q:

How long have i been alive?

Answer

This is a different way of asking your age. It can be how long you have been living in days weeks months and years since your birth date.

Report Error

View answer Workspace Report Error Discuss

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

4 2350