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

Which river has no mention in Rigaveda

A) Sindhu B) Saraswati
C) Yamuna D) Periyar
 
Answer & Explanation Answer: D) Periyar

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: Indian History

2 4152
Q:

Train A, travelling at 84 kmph, overtook train B, traveling in the same direction, in 10 seconds. If train B had been traveling at twice its speed, then train A would have taken 22.5 seconds to overtake it. Find the length of train B, given that it is half the length of train A.

A) 180 m B) 100 m
C) 200 m D) 150 m
 
Answer & Explanation Answer:

Explanation:

Let speed of train B be x m/s And length of train B be y m
Then length of train A is 2y m
Speed of train A = 84 × 5/18 = 210/9 m/s = 70/3 m/s
A.T.Q, (2y+y)/10 = 70/3 − x .............(i)
and (2y+y)/ 22.5 = 70/3 − 2x ................(ii)
solving (i) and (ii), y = 50 m

Report Error

View Answer Report Error Discuss

0 4151
Q:

Number of moles of CO2 present in 24 grams of carbon is

A) 0.5 B) 1
C) 2 D) 0.25
 
Answer & Explanation Answer: C) 2

Explanation:

1 mole of CO2 contain 12gms of carbon and 44 gms of CO2

therefore  24 gms of carbon is present in 88 gms of CO2 or 2 moles of CO2

Report Error

View Answer Report Error Discuss

Filed Under: Chemistry

7 4149
Q:

As per "Swachh Survekshan 2017" records India's cleanest city is  ?

A) Hyderabd B) Tirupathi
C) Indore D) Bangalore
 
Answer & Explanation Answer: C) Indore

Explanation:

i. The 'Swachh Survekshan 2017' survey results were recently announced by Urban Development Minister M Venkaiah Naidu. The total 434 cities of India were surveyed. Indore in Madhya Pradesh is India’s cleanest city while Gonda in Uttar Pradesh is the dirtiest.

ii. Gujarat has the maximum of 12 cities among the top 50 clean cities, closely followed by Madhya Pradesh with 11 and Andhra Pradesh with eight. Uttar Pradesh accounted for half of the bottom 50 cities in the cleanliness ranking.

Top 10 clean cities of India in 2017 are:

Indore (MP)
Bhopal (MP)
Visakhapatnam (Andhra Pradesh)
Surat (Gujarat)
Mysuru (Karnataka)
Tiruchirapally (Tamil Nadu)
New Delhi Municipal Council (New Delhi)
Navi Mumbai (Mumbai)
Tirupati (Andhra Pradesh)
Vadodara (Gujarat).

Top 5 Dirtiest cities of India (with Rank) in 2017 are:

Gonda (UP)- 434,
Bhusawal (Maharashtra)- 433,
Bagaha (Bihar)- 432,
Hardoi (Uttarakhand)- 431,
Katihar (Bihar)- 430.

Report Error

View Answer Report Error Discuss

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

2 4149
Q:

Baburnama was written in which language?

A) Chagatai Turkic B) Bahrani Arabic
C) Para-Mongolic D) Hijazi Arabic
 
Answer & Explanation Answer: A) Chagatai Turkic

Explanation:

Baburnama was the autobiography of founder of the Mughal Empire Babur. It is wrtten in Chagatai Turkic language, which is his mother tongue.

Report Error

View Answer Report Error Discuss

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

4 4148
Q:

National Commission for Backward Classes was set up in 

A) 1991 B) 1992
C) 1993 D) 1994
 
Answer & Explanation Answer: C) 1993

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: General Awareness

6 4146
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 4146