4.5k views

Let $A(1:8, -5:5, -10:5)$ be a three dimensional array. How many elements are there in the array $A$?

1. $1200$
2. $1408$
3. $33$
4. $1050$
in DS | 4.5k views

I am just attempting it not sure

Here i think they have specified the size

So 1:8 mean 8 elements ( both are inclusive  )

(-5 : 5 ) mean 11 elements

(-10 : 5 ) mean 16 elements

So no of elements will be ( just like Multidimensional array will be ) 8*11*16=1408

so option b
by Loyal (9.9k points)
selected by
0
Whats (minus) indicates?
0

starting index of array is some negative number, as per C standards it starts at 0 but neednot be the same case in all other programming languages.

Here -5:5 means, index range here is : { -5,-4,-3,-2,-1,0,1,2,3,4,5 } and it's equal to 11 elements.

ul = upper limit

ll=lower limit

(ul3-ll3+1) x  (ul2-ll2+1) x(ul1-ll1+1) =(8-1+1) x( 5- (-5)+1)  x   (5 +10+1) =1408
by (319 points)
1408
by (19 points)