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

Which organelles are unique to plant cells?

A) Central vacuole B) Chlorophyll
C) Cell wall D) All of the above
 
Answer & Explanation Answer: D) All of the above

Explanation:
Report Error

View Answer Report Error Discuss

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

3 2330
Q:

Improve the bracketed part of the sentence.
(People have been long known) how important the trees are to them.

A) People have to know long B) People had long known
C) People have long known D) No improvement
 
Answer & Explanation Answer: C) People have long known

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: English
Exam Prep: Bank Exams

0 2330
Q:

The ore which is found in abundance in India is

A) fluorspar B) magnetite
C) monazite D) bauxite
 
Answer & Explanation Answer: C) monazite

Explanation:

The ore which is found in abundance in India is monazite.

Report Error

View Answer Report Error Discuss

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

1 2330
Q:

In a parliamentary system, from where are cabinet members drawn

A) Judicial branch B) Legislative branch
C) Executive branch D) All of the above
 
Answer & Explanation Answer: B) Legislative branch

Explanation:

In a parliamentary system, the members of the cabinet are drawn from the legislative branch.

Report Error

View Answer Report Error Discuss

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

5 2330
Q:

Which compressor is usually used in AC?

A) Centrifugal B) Rotary
C) Reciprocating D) Axial
 
Answer & Explanation Answer: C) Reciprocating

Explanation:

A compressor is a mechanical device that increases the pressure of a gas by reducing its volume. An air compressor is a specific type of gas compressor. The capacity of the air conditioning depends entirely on the capacity of the compressor. The reciprocating compressor is usually used in AC.

Which_compressor_is_usually_used_in_AC1559283550.jpg image

The reciprocating compressor have piston and cylinder arrangement like the automotive engine. The reciprocating motion of the piston due to external power compresses the refrigerant inside the cylinder.

There are three types of reciprocating compressors:

hermetically sealed,

semi-hermetically sealed and

open type.

Report Error

View Answer Report Error Discuss

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

5 2330
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 2330
Q:

Which state has become the first state to deploy specially-trained dogs to check smuggling of liquor?

A) Bihar B) Uttar Pradesh
C) Telangana D) Maharashtra
 
Answer & Explanation Answer: A) Bihar

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

2 2329