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

The largest producer of fruits in the Anglo-American Region is _____

A) New - England Region B) Greak Lakes Region
C) California D) Application Region
 
Answer & Explanation Answer: C) California

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: World Geography

0 4184
Q:

The amount of RAM storage is measured in

A) bytes B) mega bytes
C) giga bytes D) All of the above
 
Answer & Explanation Answer: D) All of the above

Explanation:

RAM storage capacity is measured in bytes, kilo bytes, mega bytes, giga bytes,...

Report Error

View Answer Report Error Discuss

2 4184
Q:

The Biggest cause of Foodborne Illness is

A) Poor Hygiene B) Toothpick
C) Employee snacking D) Virus
 
Answer & Explanation Answer: A) Poor Hygiene

Explanation:

The Biggest cause of Foodborne Illness is Poor Personal Hygiene.

Foodborne Illness is caused by consuming contaminated foods or beverages. Many different disease-causing microbes or pathogens can contaminate foods, so there are many different types of foodborne illnesses.

Report Error

View Answer Report Error Discuss

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

7 4184
Q:

Which company received top honors at the 2017 Frost & Sullivan India Digital Transformation Awards  ?

A) Spice Communications B) Reliance Communications
C) Brocade Communications D) Tata Communications
 
Answer & Explanation Answer: D) Tata Communications

Explanation:

At 2017 Frost & Sullivan India Digital Transformation Awards. Tata Communications received top honors at the 2017 Frost & Sullivan India Digital Transformation Awards, with four awards in the Enterprise Telecom Services category and one award in the Enterprise Infrastructure category. T ata Communications took centerstage at the awards ceremony and received four Service Provider of the Year awards for: (1) Enterprise Data (2) Hosted Contact Center (3) Enterprise Telecom – Large Enterprise Segment, and (4) Third Party Datacenter. It also won New Product/Service Innovation Award for IoT – a new award category this year.

Report Error

View Answer Report Error Discuss

Filed Under: General Awareness

3 4183
Q:

The Pahari School , Rajput School, Mughal School, and Kangra School represent different styles of Indian

A) Music B) Dancing
C) Painting D) Architecture
 
Answer & Explanation Answer: C) Painting

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: General Awareness

2 4180
Q:

Which player has become the first left-arm spinner to take 400 wickets in Test cricket ?

A) Ravindra Jadeja B) Mitchell Starc
C) Rangana Herath D) Kuldeep Yadav
 
Answer & Explanation Answer: C) Rangana Herath

Explanation:
Report Error

View Answer Report Error Discuss

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

14 4179
Q:

Gear Lapping is an operation

A) for gear reconditioning B) prior to heat treatment
C) after heat treatment D) None of the above
 
Answer & Explanation Answer: C) after heat treatment

Explanation:

Gear Lapping is an operation after heat treatment. Gear lapping is the process of imparting a very fine finish and high degree of accuracy to gear teeth, by using a lapping tool and applying a fine-grained abrasive between a work material and a closely fitting surface, called a lapping plate.

Gear_Lapping_is_an_operation1554186430.jpg image

Report Error

View Answer Report Error Discuss

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

1 4178