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

Mina is the tribe of

A) Assam B) Rajasthan
C) Bihar D) Tripura
 
Answer & Explanation Answer: B) Rajasthan

Explanation:
Report Error

View Answer Report Error Discuss

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

19 2345
Q:

How long is a term in the house of representatives?

A) 5 B) 2
C) 4 D) 6
 
Answer & Explanation Answer: B) 2

Explanation:

Members of the House of Representatives serve two-year terms and are considered for reelection every even year.

Report Error

View Answer Report Error Discuss

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

2 2345
Q:

What is fingerprint powder made of?

A) Rosin B) Black ferric oxide
C) Lamp black D) All of the above
 
Answer & Explanation Answer: D) All of the above

Explanation:
Report Error

View Answer Report Error Discuss

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

1 2345
Q:

Glass is made of the mixture of

A) sand and silicates B) quartz and sand
C) mica and quartz D) mica and silicates
 
Answer & Explanation Answer: A) sand and silicates

Explanation:

A glass is made of liquid sand. You can make glass by heating ordinary sand and made into a liquid and mix with silicates to form a glass.

Report Error

View Answer Report Error Discuss

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

6 2344
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 2344
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.


Without breakfast, all of us ­ irrespective of age ­ are likely to experience the late morning slump; tiredness, sleepiness and the urge to sit back. Our efficiency goes down further as the day progresses.Moreover, skipping the first meal of the day leads to intense hunger pangs by late morning and we end up eating chips, samosas, burgers or other high­ fat unhealthy foods. Break fast­skippers are more likely to be overweight. A good breakfast leads to a more active, productive day. Research has found a definite connection between skipping breakfast and memory impairment in both young and older adults. Moreover, breakfast is directly linked with performance in school and college. Breakfast should contribute at least one ­fourth of our daily requirement of nutrients. An ideal breakfast should contain adequate amounts of carbohydrates, proteins and fats in addition to minerals and vitamins. Essentially this means including most of our food groups in the morning meal. Whole grain cereals ­ like atta in parathas and puris, dalia, suji, etc. are an integral part of the traditional Indian breakfast. Their high fibre and protein content provides a feeling of satisfaction, which lowers the urge to snack before lunch. On the other hand, high­ sugar foods actually make people sleepier, not active.

Milk, cheese, eggs or dals (as sprouts in idli or dosas or as sambhar) are other protein sources. A serving of milk (one cup) provides B­ complex vitamins and also minerals like zinc, magnesium and calcium. Fruits or vegetables provide valuable vitamin C and keep constipation away.

 

An ideal breakfast should contain

A) carbohydrates, proteins, fats, minerals and vitamins B) some food groups
C) only high fibre and protein D) foods of our choice
 
Answer & Explanation Answer: A) carbohydrates, proteins, fats, minerals and vitamins

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: English
Exam Prep: Bank Exams

0 2344
Q:

Which aricle of the UN charterr established the International Trusteeship system

A) 78 B) 79
C) 75 D) 74
 
Answer & Explanation Answer: C) 75

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: World Organisations

0 2344