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 3754
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 3753
Q:

Gases used in normal welding?

A) Oxygen and Acetylene B) Acetylene and Nitrogen
C) Oxygen, Hydrogen and Acetylene D) Oxygen and Hydrogen
 
Answer & Explanation Answer: A) Oxygen and Acetylene

Explanation:

Normal Gas welding use oxygen-acetylene.

 

Depending on what materials you are welding, there are some more options that might be used.

For example - MIG/TIG use Argon, MAG use an argon-something mix.

Report Error

View Answer Report Error Discuss

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

1 3753
Q:

Ecology deals with the study of

A) Environment B) Birds
C) Organisms and their Environment D) Living beings
 
Answer & Explanation Answer: C) Organisms and their Environment

Explanation:

ecology_deals_with_the_study_of1553078201.png image

Ecology is the branch of science which deals with the study of Ecosystem (relation between the Organisms and their Environment.)

Report Error

View Answer Report Error Discuss

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

16 3751
Q:

Antibiotics are mostly obtained from

A) Viruses B) Fungi
C) Bacteria D) Angiosperms
 
Answer & Explanation Answer: B) Fungi

Explanation:
Report Error

View Answer Report Error Discuss

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

8 3750
Q:

The command to eliminate a table from a database is

A) REMOVE TABLE CUSTOMER; B) UPDATE TABLE CUSTOMER;
C) DELETE TABLE CUSTOMER; D) DROP TABLE CUSTOMER;
 
Answer & Explanation Answer: D) DROP TABLE CUSTOMER;

Explanation:

The SQL DROP TABLE statement is used to remove a table definition and all data, indexes,...

Report Error

View Answer Report Error Discuss

4 3749
Q:

Answer the following puzzle

Answer

To the 6


Explanation:


Starting with the top left clockface and working clockwise around the others, the sum of the numbers pointed to by the 2 hands starts at 3 and increases by 2 each time.

Report Error

View answer Workspace Report Error Discuss

Subject: Clock puzzles

13 3747
Q:

A capillary tube is partially dipped vertically in a vessel containing water. Due to capillarity  water rises in the tube. The height of water rise in the tube can be increased by 

A) decreasing the radius of the capillary tube B) increasing the radius of the capillary tube
C) increasing the height of water in the vessel D) None of these
 
Answer & Explanation Answer: A) decreasing the radius of the capillary tube

Explanation:

The water rise in a capillary tube dipped in water is such that the weight of water in the tube above the surface of water in the vessel is equal to (balances) the upward force due to surface tension. So it is clear that if the the bore (radius) to the tube is decreased, the height of the water column in it must be greater.  So, (a) is correct.

Report Error

View Answer Report Error Discuss

Filed Under: Physics

4 3745