Questions

Q:

Write a c program to find out sum of diagonal element of a matrix.

Answer

#include<stdio.h>

int main(){

  int a[10][10],i,j,sum=0,m,n;

  printf("\nEnter the row and column of matrix: ");
  scanf("%d %d",&m,&n);

  printf("\nEnter the elements of matrix: ");
  for(i=0;i<m;i++)
      for(j=0;j<n;j++)
           scanf("%d",&a[i][j]);
  printf("\nThe matrix is\n");

  for(i=0;i<m;i++){
      printf("\n");
      for(j=0;j<m;j++){
      printf("%d\t",a[i][j]);
      }
 }
 for(i=0;i<m;i++){
     for(j=0;j<n;j++){
          if(i==j)
              sum=sum+a[i][j];
     }
 }
 printf("\n\nSum of the diagonal elements of a matrix is: %d",sum);

 return 0;
}

Sample output:

Enter the row and column of matrix: 3 3
Enter the elements of matrix:
2
3
5
6
7
9
2
6
7
The matrix is
2       3       5
6       7       9
2       6       7
Sum of the diagonal elements of a matrix is: 16

Report Error

View answer Workspace Report Error Discuss

Subject: Programming

1 4326
Q:

Modem is used mostly for ?

A) A modern empty memory modules B) Connecting to internet
C) Mostly for file system D) All the above
 
Answer & Explanation Answer: B) Connecting to internet

Explanation:

A modem is nothing but short for Modulator and Demodulator. It is used mostly for connecting to the internet.

A modem is a device or program that enables a computer to transmit data over, for example, telephone or cable lines. Computer information is stored digitally, whereas information transmitted over telephone lines is transmitted in the form of analog waves.

 

Report Error

View Answer Report Error Discuss

Filed Under: Physics
Exam Prep: AIEEE , Bank Exams , GATE
Job Role: Analyst , Bank Clerk , Bank PO

4 4326
Q:

How many Teaspoons in a Tablespoon?

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

Explanation:

Tablespoon > Teaspoon

In US & UK, 1 Tablespoon = 3 Teaspoons.

Report Error

View Answer Report Error Discuss

7 4325
Q:

What is the capital of colombia?

A) Beijing B) Dacota
C) Bogota D) Moroni
 
Answer & Explanation Answer: C) Bogota

Explanation:

Capital of Colombia is Bogota

Report Error

View Answer Report Error Discuss

Filed Under: Country Capitals

17 4325
Q:

Who is the author of the book ' The Goldfinch'

Answer

Donna Tratt

Report Error

View answer Workspace Report Error Discuss

25 4324
Q:

Which of the following is an example of representative money?

A) Salt B) A tract of land
C) Gold D) A check
 
Answer & Explanation Answer: D) A check

Explanation:

Representative money is an item such as a token or piece of paper that has no intrinsic value but can be exchanged on demand for a commodity that does have intrinsic value, such as gold, silver, copper,...

 

Hence, a Check is an example of representative money.

Report Error

View Answer Report Error Discuss

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

9 4324
Q:

All atoms of uranium have the same

A) Atomic mass B) Number of electrons
C) Atomic number D) Mass number
 
Answer & Explanation Answer: C) Atomic number

Explanation:

There are many isotopes of uranium and all of them have same atomic number i.e, sum of nmber of neutrons and protons.

Report Error

View Answer Report Error Discuss

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

4 4324
Q:

Which statement describes the acid found in vinegar acetic acid ?

A) It feels slippery B) It reacts with Mg to produce H2
C) It tastes bitter D) It releases OH- in a solution
 
Answer & Explanation Answer: B) It reacts with Mg to produce H2

Explanation:

Acid which is present in vinegar is approximately 5 % of acetic acid. This can be confirmed by testing the vinegar with magnesium which gives out hydrogen as a gas.

Report Error

View Answer Report Error Discuss

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

0 4322