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

What is the political party of the president now?

A) BJP B) INC
C) BSP D) NCP
 
Answer & Explanation Answer: A) BJP

Explanation:

Ram Nath Kovind, the present President of India is from BJP, Bharatiya Janata Party.

The president of the Republic India is the head of state of India. He is also the commander-in-chief of Indian Armed Forces. He is indirectly elected by the people through members of both houses of the parliament of India, legislative assemblies of all the states of India, the legislative assembly of the Union

Report Error

View Answer Report Error Discuss

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

1 4277
Q:

What do you call elements with Atomic Number between 57 and 71?

Answer

'Rare earth'(They are all metals)

Report Error

View answer Workspace Report Error Discuss

Subject: General Science

10 4276
Q:

Phycology is the branch of botany in which we study about__________

A) Algae B) fungi
C) Ecology D) Virus
 
Answer & Explanation Answer: A) Algae

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: Biology

6 4275
Q:

Garba a popular folk dance is associated with Indian state

Answer

Gujarat

Report Error

View answer Workspace Report Error Discuss

Subject: Indian Culture

53 4272
Q:

An Oracle System Change Number (SCN):

A) is a value that is incremented whenever a dirty read occurs. B) is incremented whenever a deadlock occurs.
C) is a value that keeps track of explicit locks. D) is a value that is incremented whenever database changes are made.
 
Answer & Explanation Answer: D) is a value that is incremented whenever database changes are made.

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: Database

0 4271
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 4271
Q:

Application layer protocol defines

A) message format, syntax and semantics B) rules for when and how processes send and respond to messages
C) types of messages exchanged D) All of the above
 
Answer & Explanation Answer: D) All of the above

Explanation:

Application layer protocol defines types of messages exchanged, message format, syntax and semantics and rules for when and how processes send and respond to messages.

Report Error

View Answer Report Error Discuss

Filed Under: Networking
Exam Prep: AIEEE
Job Role: Network Engineer

8 4265