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

What is Executive in Windows NT?

Answer

In Windows NT, executive refers to the operating system code that runs in kernel mode.

Report Error

View answer Workspace Report Error Discuss

1 2518
Q:

Can You Guess The Missing Numbers In The Given Math Puzzle?

A) B)
C) D)
 
Answer & Explanation Answer: A)

Explanation:

Let the missing numbers be x, y, a and b

x + y = 8 ---- (1)
a - b = 6 ---- (2)
x + a = 13 --- (3)
y + b = 8 ---- (4)

2x + a + y = 21 --- From (1 & 3)
a + y = 14 ----  From (2 & 4)

Substitute (2 & 4) in (1 & 3)

2x + 14 = 21
2x = 7
x = 3.5

From (1) ---> 3.5 + y = 8
=> y = 8 - 3.5 = 4.5

a + y = 14 => a = 14 - y = 14 - 4.5 => a = 9.5
From (4) ---- y + b = 8 => b = 8 - y = 8 - 4.5 = 3.5

Hence,
x = 3.5
y = 4.5
a = 9.5
b = 3.5

Report Error

View Answer Report Error Discuss

Filed Under: Math Puzzles
Exam Prep: CAT , Bank Exams

14 2518
Q:

Where was christianity founded?

A) Jerusalem B) Bethlehem
C) Palestine D) None of the above
 
Answer & Explanation Answer: A) Jerusalem

Explanation:

Christianity was founded by hesus Christ in Jerusalem, capital of Israel.

Report Error

View Answer Report Error Discuss

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

7 2518
Q:

Where is the headquaters of the UN industrial Development Organization

A) Vienna.Austria B) New Delhi
C) Washington DC D) None of these
 
Answer & Explanation Answer: A) Vienna.Austria

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: World Organisations

0 2518
Q:

A sentence has been given in Direct/Indirect Speech. Out of the four given alternatives, select the one which best expresses the same sentence in Indirect/Direct Speech.

He says, “I am a little bit afraid.”

 

A) He was a little bit afraid, he said. B) He said he was afraid.
C) He says that he is a little bit afraid. D) He says that he was a little bit afraid.
 
Answer & Explanation Answer: C) He says that he is a little bit afraid.

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: English
Exam Prep: Bank Exams , GRE

0 2518
Q:

Which of the following is a property of sodium hydroxide?

A) It is insoluble in ether and other Non-polar solvents B) It is slowly soluble in water
C) It has an odor of rotten egg smell D) All the above
 
Answer & Explanation Answer: A) It is insoluble in ether and other Non-polar solvents

Explanation:

Sodium hydroxide, also known as lye and caustic soda, is an inorganic compound with the formula NaOH. It is a white solid ionic compound consisting of sodium cations Na+ and hydroxide anions OH−.

Properties:

1. It is highly soluble in water, and readily absorbs moisture and carbon dioxide from the air.

2. NaOH is insoluble in ether and other non-polar solvents.

3. It is an odorless compound.

 

Uses:

Sodium hydroxide is used in many industries: in the manufacture of pulp and paper, textiles, drinking water, soaps and detergents, and as a drain cleaner.

Report Error

View Answer Report Error Discuss

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

1 2518
Q:

Metals that are liquid at room temperature?

A) Caesium B) Gallium
C) Rubidium D) Mercury
 
Answer & Explanation Answer: D) Mercury

Explanation:

Mercury is the only metal that is in liqid form at room temperature. Caesium, Gallim and Rubidium are also metals that are in liquid form but at slightly high temperature than the room temperature.

Report Error

View Answer Report Error Discuss

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

1 2518