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

The type of fracture where bone is broken at several places

A) Complicated fracture B) Green stick fracture
C) Impact fracture D) Comminuted fracture
 
Answer & Explanation Answer: D) Comminuted fracture

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: Biology

8 4056
Q:

What is Kerberos?

Answer

It is an authentication service developed at the Massachusetts Institute of Technology. Kerberos uses encryption to prevent intruders from discovering passwords and gaining unauthorized access to files.

Report Error

View answer Workspace Report Error Discuss

Subject: Networking
Job Role: Network Engineer

1 4055
Q:

Atomic weight of an element is given by

A) sum of neutrons and electrons B) sum of neutrons and protons
C) only neutrons D) only protons
 
Answer & Explanation Answer: A) sum of neutrons and electrons

Explanation:

Atomic weight=number of neutrons+number of protons

Report Error

View Answer Report Error Discuss

Filed Under: Chemistry

7 4054
Q:

I have four fingers and a thumb, but not alive.

Who am I?

Answer

A glove. It has 5 fingers as we have but not alive.

Report Error

View answer Workspace Report Error Discuss

Subject: Logic Puzzles Exam Prep: GATE , CAT , Bank Exams , AIEEE
Job Role: Bank PO , Bank Clerk , Analyst

2 4054
Q:

Math Logic Challenge

18582095_1309614185812349_1823149961450714717_n1499156071.jpg image

A) 23 B) 26
C) 13 D) 29
 
Answer & Explanation Answer: B) 26

Explanation:

Let the integer be x. Then,

 x2-20x = 156

 

(x + 6)(x - 26) = 0

 

x = 26

 

The integer is 26.

Report Error

View Answer Report Error Discuss

Filed Under: Math Puzzles
Exam Prep: GATE , CAT , Bank Exams , AIEEE
Job Role: Bank PO , Bank Clerk

12 4051
Q:

Delphi, the world's largest auto component manufacturer, has the joint venture agreement with which indian company?

A) TVS B) Bajaj Auto
C) Hero Motors D) Bharat Forge
 
Answer & Explanation Answer: A) TVS

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: Business Awareness

7 4051
Q:

Diameter of a Ping Pong Ball?

A) 37 mm B) 38 mm
C) 40 mm D) 42 mm
 
Answer & Explanation Answer: C) 40 mm

Explanation:

The ball with which Table Tennis is played is called Ping Pong Ball.

According to the International rules, the diameter of the ping pong ball must be not less than 39.5 millimeters and not greater than 40.5  millimeters having a mass of 2.7 grams.

Report Error

View Answer Report Error Discuss

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

14 4050