Explanation
To solve this, we need to evaluate the expressions step-by-step based on the given rule A[i]=2i.
Step 1: Understand the array elements
The array A is defined such that each element is double its index:
-
A[1]=2(1)=2
-
A[2]=2(2)=4
-
... and so on.
Step 2: Evaluate the assignment j=A[A[5]]
First, we find the inner value:
Now, substitute this value back into the expression for j:
Step 3: Determine the value of A[j]
The question asks for the value of A[j], where j=20.
Step 4: Check for Array Bounds
The problem statement explicitly defines the array A for the range 1≤i≤10. This means the array only has 10 elements (indices 1 through 10).
Since j=20, the index is out of bounds. In most programming contexts and mathematical logic for fixed-size arrays, accessing an index outside the defined range results in an undefined value or an error.
Final Answer:
The correct option is (a) undefined