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

How do you display current date and time in MS Excel ?

A) Time () B) Now ()
C) Date () D) Today ()
 
Answer & Explanation Answer: B) Now ()

Explanation:

To display current date and time in MS Excel, we use Now() method. 

Report Error

View Answer Report Error Discuss

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

15 4094
Q:

What cannot be performed from the windows task manager?

A) Open a program B) Check recent CPU usage
C) Delete a program from the hard drive D) View what applications are running in the background
 
Answer & Explanation Answer: C) Delete a program from the hard drive

Explanation:

The task manager enables you to monitor processes, applications and services currently running on your computer. You can use it to start and stop programs and processes. In addition, you can use the task manager to show informative stats about your PC’s performance and network.

 


Hence, to delete a program from the hard drive, you have to go to the control panel to uninstall an application properly.

 

Report Error

View Answer Report Error Discuss

6 4094
Q:

Atomic weight of an element is given by

A) sum of neutrons and electrons B) sum of neutrons and protons
C) only neutrons D) only protons
 
Answer & Explanation Answer: A) sum of neutrons and electrons

Explanation:

Atomic weight=number of neutrons+number of protons

Report Error

View Answer Report Error Discuss

Filed Under: Chemistry

7 4094
Q:

What is the official language of African Export and import Bank

A) Egypt B) Senegal
C) Dauber D) None of these
 
Answer & Explanation Answer: A) Egypt

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: World Organisations

4 4093
Q:

If there are 17 randomly placed dots on a circle,how many lines can you form using any 2 dots?

A) 126 B) 130
C) 136 D) 120
 
Answer & Explanation Answer: C) 136

Explanation:

17C2 = 136 (combination)

Report Error

View Answer Report Error Discuss

0 4093
Q:

Who was the founder of Mahakali Pathshala in Calcutta?

A) Her Holiness Mataji Maharani Tapaswini B) Sister Nivedita
C) Madamee Blavatsky D) Sarojini Naidu
 
Answer & Explanation Answer: A) Her Holiness Mataji Maharani Tapaswini

Explanation:

Mataji Maharani Tapaswini was one of the strongest proponents of female education in India. Her greatest contribution came in the form of the Mahakali Pathshala which she set up in Kolkata in 1893.

The school was a completely indigenous affair which did not rely on either foreign aid or assistance. The education of girls was carried out on a strictly national basis in the hopes that they would be able to revive and regenerate Hindu society.

Report Error

View Answer Report Error Discuss

Filed Under: Indian History
Exam Prep: Bank Exams

6 4091
Q:

The famous song ‘Saare Jaha se Achha’ is composed by ___________

A) Ravindra Nath Tagore B) Bankim Chandra Chattopadhya
C) Mohammad Iqbal D) one of the above
 
Answer & Explanation Answer: C) Mohammad Iqbal

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: Indian Culture

53 4091