दिए गए कोड के अनुक्रमण के लिए सही विकल्प चुनें:
Choose the correct option for indexing of the given code:
int main ()
{
int xyz (8);
return 0;
}
A)
B)
C)
D)
Explanation:
Let's analyze the code and the concept of indexing in C.
Code:
int main ()
{
int xyz[8];
return 0;
}
Explanation:
int xyz[8];
declares an arrayxyz
of 8 integers.- In C, arrays are 0-indexed, meaning the indices start from 0 and go up to
n-1
wheren
is the size of the array.
So, the valid indices for the array xyz
with size 8 will be from 0 to 7.
Indexing:
- The first element will be at index 0.
- The last element will be at index 7.
Conclusion:
The correct indexing range for this array is 0 to 7.
Correct Answer:
(A) 0,7.