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

The question below consists of a set of labelled sentences. Out of the four options given, select the most logical order of the sentences to form a coherent paragraph.

But this does not mean

X-phenomena to the body
Y-is a meaningless expression
Z-that the reference of mental

A) YZX B) ZXY
C) YXZ D) XZY
 
Answer & Explanation Answer: B) ZXY

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: English
Exam Prep: Bank Exams

0 2508
Q:

The question below consists of a set of labelled sentences. Out of the four options given, select the most logical order of the sentences to form a coherent paragraph.
I've taken out my
X-and stay poised and vigilant
Y-ear buds so I can
Z-listen for announcements

A) ZXY B) YZX
C) XZY D) YXZ
 
Answer & Explanation Answer: B) YZX

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: English
Exam Prep: Bank Exams

0 2508
Q:

Read the passage carefully and choose the best answer to each question out of the four alternatives and click the button corresponding to it.


Learning is the knowledge of that which is not generally known to others, and which we can only derive at second­hand from books or other artificial sources. The knowledge of that which is before us, or about us, which appeals to our experience, passions, and pursuits, to the bosoms and businesses of men, is not learning. Learning is the knowledge of that which none but the learned know. He is the most learned man who knows the most of what is farthest removed from common life and actual observation. The learned man prides himself in the knowledge of names, and dates, not of men or things. He thinks and cares nothing about his next­door neighbours, but he is deeply read in the tribes and castes of the Hindoos and Calmuc Tartars. He can hardly find his way into the next street, though he is acquainted with the exact dimensions of Constantinople and Peking. He does not know whether his oldest acquaintance is a knave or a fool, but he can pronounce a pompous lecture on all the principal characters in history. He cannot tell whether an object is black or white, round or square, and yet he is a professed master of the optics and the rules of perspective.


The passage suggests that a learned man

A) understands his neighbours B) does not know his old acquaintances
C) is not concerned about names and dates D)  is interested in travelling
 
Answer & Explanation Answer: B) does not know his old acquaintances

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: English
Exam Prep: Bank Exams

0 2508
Q:

Which formula represents a polar molecule?

A) C - O B) C - N
C) H - N D) All of the above
 
Answer & Explanation Answer: D) All of the above

Explanation:

A chemical bond in which the electrons are not shared equally due to differences in the electronegativity of the atoms.

 

The polarity of a covalent bond is measured using its dipole moment.

 Large dipole moment = more polar

 Small dipole moment = more nonpolar.

Report Error

View Answer Report Error Discuss

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

2 2508
Q:

Which of the following is an Inert Gas?

A) Hydrogen B) Nitrogen
C) Oxygen D) Argon
 
Answer & Explanation Answer: D) Argon

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: Chemistry
Exam Prep: Bank Exams

1 2508
Q:

If depreciation exceeds gross investment

A) the economy's stock of capital is growing B) the economy's stock of capital may be either growing or shrinking
C) net investment is zero D) the economy's stock of capital is shrinking
 
Answer & Explanation Answer: D) the economy's stock of capital is shrinking

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

0 2508
Q:

Different forms of genes are called

A) Genomes B) Allele
C) Genotypes D) None of the above
 
Answer & Explanation Answer: B) Allele

Explanation:
Report Error

View Answer Report Error Discuss

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

4 2508