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

A research team of 6 people is to be formed from 10 chemists,5 politicians, 8 economists and 15 biologists.How many teams have atleast 5 chemists?

A) 7350 B) 6400
C) 6379 D) 7266
 
Answer & Explanation Answer: D) 7266

Explanation:

10C5 x 28C1 x 10C6 = 7266

Report Error

View Answer Report Error Discuss

0 4189
Q:

Which is not associated with areas of karst topography?

A) flowing rivers B) sinkholes
C) sinking streams D) caverns
 
Answer & Explanation Answer: A) flowing rivers

Explanation:

A karst topography is that which composes of limestone and its associated features and structures. Karst topography and caves develop in limestone rocks due to their solubility in dilute acidic groundwater. The solubility of limestone in water and weak acid solutions leads to karst landscapes.

 

Flowing rivers, can be found in areas away from karst topography.

Report Error

View Answer Report Error Discuss

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

17 4189
Q:

The Indian to beat the computers in mathematical wizardry is

A) Shakuntala Devi B) Raja Ramanna
C) Rina Panigrahi D) Ramanujam
 
Answer & Explanation Answer: A) Shakuntala Devi

Explanation:
Report Error

View Answer Report Error Discuss

3 4188
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 4187
Q:

I have four fingers and a thumb, but not alive.

Who am I?

Answer

A glove. It has 5 fingers as we have but not alive.

Report Error

View answer Workspace Report Error Discuss

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

2 4186
Q:

The first attempt made to enumerate the population of India was done in which year ?

A) 1884 B) 1896
C) 1921 D) 1872
 
Answer & Explanation Answer: D) 1872

Explanation:
Report Error

View Answer Report Error Discuss

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

8 4184
Q:

...................was conferred Sahitya Akademi Award for his poetry book Khara Zaran

A) Mr. Chinu Modi B) Robin Sharma
C) Gunvant Shah D) Narendra kohli
 
Answer & Explanation Answer: A) Mr. Chinu Modi

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: Honours and Awards

3 4183