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

In which year , the distribution of Bharat Ratna award started?

A) 1954 B) 1956
C) 1952 D) 1950
 
Answer & Explanation Answer: A) 1954

Explanation:

The Bharat Ratna is the highest civilian award of the Republic of India. Instituted in 1954, the award is conferred "in recognition of exceptional service/performance of the highest order", without distinction of race, occupation, position, or sex.

bharat_ratna1532341432.jpg image

Report Error

View Answer Report Error Discuss

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

3 2452
Q:

Regarding the Magna Carta, which statement is false?

A) The document assured all English citizens freedom of speech. B) The document required trial by a jury of one's peers.
C) The meeting of the English Barons and King John occurred at Runnymede. D) King John was forced to sign the document.
 
Answer & Explanation Answer: B) The document required trial by a jury of one's peers.

Explanation:
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 2451
Q:

Economics involves marginal analysis because

A) marginal benefits always exceed marginal costs B) much economic behavior is irrational
C) most decisions involve changes from the present situation D) marginal costs always exceed marginal benefits
 
Answer & Explanation Answer: C) most decisions involve changes from the present situation

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

3 2451
Q:

Select the antonym of
to remand

A) to filibuster B) to tarry
C) to expedite D) to adjourn
 
Answer & Explanation Answer: C) to expedite

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: English
Exam Prep: Bank Exams

0 2451
Q:

Find the current (in A) when a charge of 1200C flows in 6 seconds.

A) 7200 B) 200
C) 100 D) 3600
 
Answer & Explanation Answer: B) 200

Explanation:
Report Error

View Answer Report Error Discuss

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

0 2451
Q:

What allows a cell to respond to a hormone?

A) hormone response element B) presence of hormone receptor
C) Adrenocorticotropic D) None of the above
 
Answer & Explanation Answer: B) presence of hormone receptor

Explanation:
Report Error

View Answer Report Error Discuss

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

2 2450
Q:

Primary productivity is not limited by

A) Time B) Availability of sunlight
C) Water D) Nutrients
 
Answer & Explanation Answer: A) Time

Explanation:

Primary productivity refers to plants that make their own food using sunlight, water and availability of nutrients. Hence, they are not limited by time.

Report Error

View Answer Report Error Discuss

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

1 2450