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 3769
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 3769
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 3767
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 3767
Q:

In 1955, Imperial Bank of India, a leadimg commercial bank of that time was nationalised and renamed as:

A) Central Bank of India B) Bank of India
C) Indian Bank D) State Bank of India
 
Answer & Explanation Answer: D) State Bank of India

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: Indian Economy

16 3766
Q:

Which Bollywood actress has been appointed as the first Indian woman ambassador (Friend of Australia) for Tourism in Australia  ?

A) Priyanka Chopra B) Aliya Bhatt
C) Parineeti Chopra D) Shilpa Shetty
 
Answer & Explanation Answer: C) Parineeti Chopra

Explanation:
Report Error

View Answer Report Error Discuss

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

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

What is one way to limit a user's access to only a specific number of accounts in the MCC?

Answer

Create a new MCC account linked to the original MCC account. Move the specified number of accounts into that MCC and grant the user access to the sub-MCC account.

Report Error

View answer Workspace Report Error Discuss

9 3762