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

I AM ALWAYS IN FRONT OF YOU BUT YOU CAN NEVER SEE ME. WHAT AM I?

Answer

It is the FUTURE, which is infront of us but we cannot see.

Report Error

View answer Workspace Report Error Discuss

Subject: Word Puzzles Exam Prep: Bank Exams

45 3779
Q:

Seagate is manufacturer of

A) harddisk B) earth moving equipment
C) picture tube D) banking software
 
Answer & Explanation Answer: A) harddisk

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: Business Awareness

14 3778
Q:

What is NVT?

Answer

It is a set of rules defining a very simple virtual terminal interaction. The NVT is used in the start of a Telnet session.

Report Error

View answer Workspace Report Error Discuss

Subject: Networking
Job Role: Network Engineer

1 3778
Q:

In addition to nitric acid, another acid which may render iron passive is 

A) acetic acid B) oxalic acid
C) chromic acid D) citric acid
 
Answer & Explanation Answer: C) chromic acid

Explanation:

Passivity of iron is due to formation of an extremely thin and impervious film of ferrosoferric oxide Fe3O4on the surface of iron. Chromic acid, being a powerful oxidising agent (like nitric acid ) renders iron passive. 

Report Error

View Answer Report Error Discuss

Filed Under: Chemistry

2 3777
Q:

Which of the following is the world's most poisonous snake called Hydrophis ?

A) Adder B) Boa
C) Cobra D) Sea Snake
 
Answer & Explanation Answer: D) Sea Snake

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: Animals and Birds
Exam Prep: AIEEE , Bank Exams , CAT
Job Role: Bank PO

20 3777
Q:

What is amodem connected to?

A) processor B) mother board
C) printer D) phone line
 
Answer & Explanation Answer: D) phone line

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: Computer
Exam Prep: Bank Exams
Job Role: Bank Clerk

14 3775
Q:

Which of the following are elements of the colder principle?

A) Keep clothing clean and dry B) Repair clothing as necessary
C) Wear clothing loose and layered D) All the above
 
Answer & Explanation Answer: D) All the above

Explanation:

In scouts, the military and most outdoor books or schools teach the COLDER principal. It is a great acronym for caring and using you clothing.

 

C - keep your clothing CLEAN. Dirt can break down the fibers of your clothing.

O - don't OVERHEAT. Sweat can lessen the effectiveness of clothing.

L - wear you clothes LOOSE and in LAYERS. Makes your system versatile.

D - stay DRY.

E - EXAMINE your clothing. Look for worn or damaged areas of you clothing.

R - REPAIR any damage that is found.

Report Error

View Answer Report Error Discuss

Filed Under: General Awareness
Exam Prep: Bank Exams
Job Role: Analyst , Bank Clerk , Bank PO

2 3772