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

What has feet and legs and nothing else?

Answer

Stocking is long sock that women wore which has legs and feet and nothing else.

Report Error

View answer Workspace Report Error Discuss

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

1 2377
Q:

The part of the Himalayas lying between Satluj and Kali rivers is known as ____________.

A) Punjab Himalaya B) Nepal Himalayas
C) Kumaon Himalayas D) Assam Himalayas
 
Answer & Explanation Answer: C) Kumaon Himalayas

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: Indian Geography
Exam Prep: Bank Exams

3 2377
Q:

At which stage in its life cycle does the silkworm yield the fiber of commercial use

A) Larva B) Egg
C) Pupa D) Imago
 
Answer & Explanation Answer: C) Pupa

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: Biology
Exam Prep: Bank Exams

3 2377
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. Integrating diversity

P: governance which is firmly grounded

Q: in international human rights law

R: goes hand in hand with

A) QPR B) RPQ
C) PRQ D) QRP
 
Answer & Explanation Answer: B) RPQ

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: English
Exam Prep: Bank Exams

0 2377
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 2377
Q:

Liquids and gases never show

A) diamagnetic property B) paramagnetic property
C) ferromagnetic property D) electromagnetic property
 
Answer & Explanation Answer: C) ferromagnetic property

Explanation:

On the basis of magnetic properties, substances are classified into three groups namely diamagnetic, paramagnetic and ferromagnetic.

As solids diffuse and reorder very slowly under ambient conditions, the net, directionally dependent (anisotropic) magnetic moment can persist. Conversely, liquids and gases freely tumble and reorder: water rearranges every few pico seconds (10^12 times per second).

Hence liquids and gases can never show ferromagnetic properties.

Report Error

View Answer Report Error Discuss

Filed Under: Physics
Exam Prep: Bank Exams

0 2377
Q:

Which state became 1st to launch a pan-India single emergency no. 112?

A) Haryana B) Himachal Pradesh
C) Madhya Pradesh D) Uttar Pradesh
 
Answer & Explanation Answer: B) Himachal Pradesh

Explanation:

Himachal Pradesh state became 1st to launch a pan-India single emergency no. 112 where all kinds of immediate help can be sought in urgent matters.

 

Under this project, an Emergency Response Centre (ERC) has been established in Shimla along with 12 district command centres (DCCs), covering the entire state. The ERC has been integrated with police (100), fire (101), health (108) and women (1090) helpline numbers to provide emergency services through the emergency number '112'.

Report Error

View Answer Report Error Discuss

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

1 2377