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

Govind Talwalkar,recipient of the recently announced B.D.Goenka Award for excellence in Journalism, was the editor of which of the following newspapers

A) LokSatta B) The Maharastra Times
C) The Tribune D) Nay Bharat Times
 
Answer & Explanation Answer: B) The Maharastra Times

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: Famous Personalities

4 3777
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 3776
Q:

What is Carbon Watch?

 

A) Watch having carbonated dial B) Glasses informing about pollution
C) Watch that informs about carbon content D) Mobile App informing about carbon footprint
 
Answer & Explanation Answer: D) Mobile App informing about carbon footprint

Explanation:

Carbon Watch is a mobile application used to assess the carbon footprint generated by any individual.

 

 

Report Error

View Answer Report Error Discuss

Filed Under: General Awareness
Exam Prep: Bank Exams

3 3775
Q:

The office of  the UN general Assembly is in

A) Vienna B) Paris
C) Newyork D) Zurich
 
Answer & Explanation Answer: C) Newyork

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: World Organisations

4 3773
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 3772
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 3771
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 3771