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

What is FtDisk?

Answer

It is a fault tolerance disk driver for Windows NT.

Report Error

View answer Workspace Report Error Discuss

1 2447
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 2446
Q:

A persistent infection is one in which

A) viral replication is unusually slow B) the disease process occurs gradually over a long period
C) the virus remains in equilibrium with the host without causing a disease D) All of the above
 
Answer & Explanation Answer: B) the disease process occurs gradually over a long period

Explanation:
Report Error

View Answer Report Error Discuss

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

3 2446
Q:

Which amongst the following is not a component of monetary policy in India?

A) Repo rate B) Moral suasion
C) Credit Rationing D) Public Debt
 
Answer & Explanation Answer: D) Public Debt

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: Indian Economy
Exam Prep: Bank Exams

1 2446
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 2446
Q:

The pH value of a sample of multiple-distilled water is

A) zero B) 14
C) very near to zero D) very near to seven
 
Answer & Explanation Answer: D) very near to seven

Explanation:

Water  is  neutral  and  has  a  pH value  of  7  and  because  here it  is multiple distilled water, it would be very near to seven

Report Error

View Answer Report Error Discuss

Filed Under: Chemistry
Exam Prep: Bank Exams

3 2446
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 2445