0 تصويتات
بواسطة
(5) Consider the following array declaration
int arr [9]= (11,3,5,2,9,23,56,0,67};
Then which of the following will be true?
(d) arr [51=2

1 إجابة واحدة

0 تصويتات
بواسطة
The array declaration provided has a syntax error. The correct way to initialize elements in an array using curly braces { } should be:
int arr[] = {11, 3, 5, 2, 9, 23, 56, 0, 67};
Given that the array initialization after correction is:
arr = {11, 3, 5, 2, 9, 23, 56, 0, 67};
Therefore, there is no element 51 in the corrected array. The expression arr[51] is not correct. Instead, an element at the index 5 can be accessed using arr[5] which would be 23 in this case.
So, the statement arr[51]=2 is not valid based on the corrected initialization of the array.
مرحبًا بك إلى ثعلب، حيث يمكنك طرح الأسئلة وانتظار الإجابة عليها من المستخدمين الآخرين.

اسئلة متعلقة

...