Knowee
Questions
Features
Study Tools

Given the array declaration int arr[5] = {1, 2, 3};, what are the values of arr[3] and arr[4]?Both arr[3] and arr[4] are 0Both arr[3] and arr[4] are uninitializedarr[3] is 3 and arr[4] is 3arr[3] is 2 and arr[4] is 2

Question

Given the array declaration int arr[5] = {1, 2, 3};, what are the values of arr[3] and arr[4]?Both arr[3] and arr[4] are 0Both arr[3] and arr[4] are uninitializedarr[3] is 3 and arr[4] is 3arr[3] is 2 and arr[4] is 2

🧐 Not the exact question you are looking for?Go ask a question

Solution

Both arr[3] and arr[4] are 0.

Similar Questions

How do you initialize an array in C?a.int arr[3] = (1,2,3);b.int arr(3) = {1,2,3};c.int arr[3] = {1,2,3};d.int arr(3) = (1,2,3);

int arr[5]={89,67,54,90,39} syntax of array initialization

Which of the following statements correctly accesses the third element of the array int arr[5]; in C?int arr[5] = {1, 2, 3, 4, 5};arr[2]arr[3]arr(2)arr(3)array[2]

Consider following;int arr[][] = {{1, 3, 5},{7,8}};Which of the following print all elements of the array “arr”?*Option 1Option 2Option 3None of above

Which of the following declarations is correct?int arr[3] = {1, 2, 3, 4};int arr[] = {1, 2, 3};int arr[3] = {1, 2};Both B and C

1/3

Upgrade your grade with Knowee

Get personalized homework help. Review tough concepts in more detail, or go deeper into your topic by exploring other relevant questions.