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 3745
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 3740
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 3740
Q:

In which core leader competency is the warrior ethos exemplified

Answer

The U.S. Army identifies eight core leadership competencies. One of these--leading by example--exemplifies the warrior ethos. The leader is always required to behave in a way that provides those under his or her command with a positive and effective role model.


 


 In_which_core_leader_competency_is_the_warrior_ethos_exemplified1558508870.jpg image


 


The warrior ethos is a value that is eschewed by the U.S. Army.


The Army defines it as the adherence to a code that includes always putting the mission first, never accepting defeat, never quitting, and never leaving behind a comrade who has fallen.

Report Error

View answer Workspace Report Error Discuss

Subject: World Organisations Exam Prep: Bank Exams
Job Role: Bank Clerk

3 3739
Q:

It is 3 in the morning, you’re sleeping and you hear the doorbell. It’s your parents who show up for a surprise visit for breakfast. You’ve got the strawberry jam, honey, bread and cheese.
What do you open first?

A) open your door B) open your mouth
C) open the fridge D) open your eyes
 
Answer & Explanation Answer: D) open your eyes

Explanation:

As you were asleep, none of the things could have happened without doing "open your eyes" first.

Report Error

View Answer Report Error Discuss

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

7 3738
Q:

In November 2017, who launched the 'Deen Dayal SPARSH Yojana' for school children?

 

A) Jayant Sinha B) Prakash Javadekar
C) Manoj Sinha D) Arun Jaitley
 
Answer & Explanation Answer: C) Manoj Sinha

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: Indian Politics
Exam Prep: Bank Exams

2 3738
Q:

‘World Sustainable Development Summit’ is organized by which institution?

 

 

A) The Energy and Resources Institute B) World Economic Forum
C) NITI Aayog D) UNDP
 
Answer & Explanation Answer: A) The Energy and Resources Institute

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: General Awareness
Exam Prep: Bank Exams

1 3737
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 3734