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

India’s who has won the girl's title in the IBSF World Under-16 Snooker Championships 2018?

A) Keerthana Pandian B) Sangeeta Chanu
C) Kumar Mangalan D) Thangjam Tababi Devi
 
Answer & Explanation Answer: A) Keerthana Pandian

Explanation:

India's Keerthana Pandian has won the girls’ title in the IBSF World Under-16 Snooker Championships.

 

In the final in St Petersburg, Russia, Keerthana outclassed her Belarussian rival Albina Leschuk 3-1.

Report Error

View Answer Report Error Discuss

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

2 2354
Q:

Farming in the early New England colonies was challenging because

A) unfamiliar weather and soil conditions affected cultivation B) English laws restricted which crops farmers could plant
C) English investors promoted manufacturing over farming D) foreign plants soon grew out of control in the American soil
 
Answer & Explanation Answer: A) unfamiliar weather and soil conditions affected cultivation

Explanation:

Farming in the early New England colonies was challenging because unfamiliar weather and soil conditions affected cultivation.

Report Error

View Answer Report Error Discuss

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

2 2354
Q:

The 8th World CSR Congress 2019 in?

A) Mumbai B) Hyderabad
C) Kolkata D) Pune
 
Answer & Explanation Answer: A) Mumbai

Explanation:

The 8th World CSR Congress 2019 in Mumbai.

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

Where do arteries carry blood?

A) Heart B) Lungs
C) Tissues D) Brain
 
Answer & Explanation Answer: A) Heart

Explanation:

Arteries carry oxygenated blood away from the heart to the tissues, except for pulmonary arteries, which carry blood to the lungs for oxygenation (usually veins carry deoxygenated blood to the heart but the pulmonary veins carry oxygenated blood as well).

Report Error

View Answer Report Error Discuss

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

4 2354
Q:

Which gas is a source of natural groundwater pollution?

A) Helium B) Krypton
C) Radon D) Argon
 
Answer & Explanation Answer: C) Radon

Explanation:

Radon gas is a source of natural groundwater pollution.

Report Error

View Answer Report Error Discuss

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

2 2354
Q:

Which one of the following is a plant hormone?

A) Cytokinin B) Oestrogen
C) Thyroxin D) Insulin
 
Answer & Explanation Answer: A) Cytokinin

Explanation:

Cytokinins is a Plant hormone which helps in cell division and leads to Growth & formation of shoots, roots & bud.

Report Error

View Answer Report Error Discuss

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

1 2353