1,364 views

1 Answer

Best answer
6 votes
6 votes

Given the dimension :

D500,51 meaning the main array size  =  500 * 500 

and there are 50 diagonals to be considered above and below the principal diagonal..As we know principal diagonal contains the elements which is equal to number of rows of array .So 500 entries in principal diagonal..

And then in each diagonal above and below , one less the previous diagonal..So we count for one side first..

So no of elements covered by 50 diagonals one side = 499 + 498 +........50 terms

                                                                             =  50 / 2 [ 998 + 49 * (-1) ]

                                                                             =  25 * [ 949 ]

                                                                             =  23725

So no of elements both sides including principal diagonal  = 23725 * 2 + 500

                                                                                    = 47950

Hence B) is the correct option.

selected by

Related questions

0 votes
0 votes
0 answers
1
0 votes
0 votes
0 answers
2
0 votes
0 votes
1 answer
3
Rohit Gupta 8 asked Nov 8, 2017
7,124 views
Let A be a square matrix of size n x n. Consider the following program. What is the expected output?C = 100 for(i=0; i<n; i++) for (j=0; j<n; j++) { Temp = A[i][j] + C A[...
0 votes
0 votes
1 answer
4
vishwa ratna asked Jan 17, 2017
1,004 views
Consider three matrices A (10 × 100), B (100 × 5), C (5 × 50). What is total number of multiplications required?Your Answer:500Correct Answer: 7500 Status: incorrec...