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

In the following question, out of the four alternatives, select the alternative which is the best substitute of the words/sentence.

Expel someone from a property, especially with the support of the law

A) Genial B) Evict
C) Cordial D) Convivial
 
Answer & Explanation Answer: B) Evict

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: English
Exam Prep: CAT , GRE , TOEFL
Job Role: Bank Clerk , Bank PO

0 2408
Q:

Gametes are produced by the process of

A) Mitosis B) Meiosis
C) Both A & B D) None of the above
 
Answer & Explanation Answer: B) Meiosis

Explanation:

A gametes are haploid cells as they have only one set of chromosomes. Meiosis is a process of cellular reproduction in which both male and female gametes are formed. During meiosis, the DNA is only replicated or copied one time.

Gametes_are_produced_by_the_process_of1560944987.png image

Report Error

View Answer Report Error Discuss

Filed Under: Biology
Exam Prep: AIEEE
Job Role: Analyst

3 2408
Q:

Improve the bracketed part of the sentence.
He has painted that picture so often that he can do it with his (eyes closed).

A) arms full B) eyes opened
C) mind blank D) No improvement
 
Answer & Explanation Answer: D) No improvement

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: English
Exam Prep: Bank Exams

0 2408
Q:

How many bits are in a MAC address?

A) 64 B) 48
C) 32 D) 16
 
Answer & Explanation Answer: B) 48

Explanation:

MAC - Media Access Control, address is a globally unique identifier assigned to network devices, and therefore it is often referred to as hardware or physical address.

 

MAC addresses are 6-byte (48-bits) in length, and are written in MM:MM:MM:SS:SS:SS format.

Report Error

View Answer Report Error Discuss

0 2408
Q:

Siachen is a

A) frontier zone between India and Myanmar B) desert frontier zone between India and Pakistan
C) glacier frontier zone between India and Pakistan D) frontier zone between China and India
 
Answer & Explanation Answer: C) glacier frontier zone between India and Pakistan

Explanation:

Siachen is a glacier frontier zone between India and Pakistan.

Siachen_is_a1554289418.jpg image

Report Error

View Answer Report Error Discuss

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

4 2408
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 2407
Q:

What is a drawback of MVT?

Answer

It does not have the features like



  1. ability to support multiple processors

  2. virtual storage

  3. source level debugging

Report Error

View answer Workspace Report Error Discuss

0 2407