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

Smallest bone of human body is _________

A) Nails B) Fibula
C) Bone of nose D) Stapes
 
Answer & Explanation Answer: D) Stapes

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: Biology

10 4069
Q:

Managing advertising, sales promotion and public relations :

what is public relations in marketing?

Answer

Public relations includes promotional activities that work to create a strong public image of the company. Public relations activities include helping the public to understand the company and its products. Public relations if done right can reach a large audience without the expensive cost of traditional advertising and marketing.

Report Error

View answer Workspace Report Error Discuss

0 4068
Q:

Famous play ' Macbeth ' is written by

A) Leo Tolstoy B) William Shakespeare
C) john Milton D) Charles Dickens
 
Answer & Explanation Answer: B) William Shakespeare

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: Books and Authors

6 4066
Q:

Under Sher Shah the largest administrative unit was administrated by a chief namely 

A) Shikadar B) Mansabdar
C) Kasi D) Faujdar
 
Answer & Explanation Answer: A) Shikadar

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: Indian History

5 4066
Q:

Outward extension of the shoulder bone is the

A) acromion B) foramen
C) cancellous bone D) All of the above
 
Answer & Explanation Answer: A) acromion

Explanation:

Outward extension of the shoulder bone is called as the acromion.

acromion1533537961.jpg image

Report Error

View Answer Report Error Discuss

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

3 4065
Q:

The main buffer system of the human blood is

A) H2CO3 B) H2SO4
C) CO2 D) O3
 
Answer & Explanation Answer: A) H2CO3

Explanation:

the_main_buffer_system_of_the_human_blood_is1556690852.jpg image

Report Error

View Answer Report Error Discuss

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

4 4065
Q:

Nucleus of Hydrogen atom consists of

A) 2 protons only B) 2 neutrons only
C) 1 proton only D) 1 electron only
 
Answer & Explanation Answer: C) 1 proton only

Explanation:

The nucleus of hydrogen consists of only a single proton.

Its parts are a single negatively-charged electron that circles a single positively-charged nucleus of the hydrogen atom.

The electron is bound to the nucleus by the Coulomb force.

Report Error

View Answer Report Error Discuss

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

4 4064