Knowee
Questions
Features
Study Tools

Choose an alternative definition of C Multidimensional array.? Int[] [3]={6,5,4,3,2,1}Select one:a.int ary[2][3] = {6,5,4,3,2,1};b.int ary[2][3] = {{6,5,4},{3,2,1}};c.int ary[][3] = {{6,5,4},{3,2,1}};d.All the above.Clear my choice

Question

Choose an alternative definition of C Multidimensional array.? Int[] [3]={6,5,4,3,2,1}Select one:a.int ary[2][3] = {6,5,4,3,2,1};b.int ary[2][3] = {{6,5,4},{3,2,1}};c.int ary[][3] = {{6,5,4},{3,2,1}};d.All the above.Clear my choice

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

Solution

The correct answer is:

b. int ary[2][3] = {{6,5,4},{3,2,1}};

This is because a multidimensional array in C is defined with multiple brackets, each representing a dimension. In this case, we have a 2D array with 2 rows and 3 columns. The values are initialized in the same order, grouped by the inner brackets to represent each row.

Similar Questions

Choose the correct way to declare 2D array.a.int x[3][4] = {0, 1 ,2 ,3 ,4 , 5 , 6 , 7 , 8 , 9 , 10 , 11};b.int x[3] = {0, 1 ,2 ,3 ,4 , 5 , 6 , 7 , 8 , 9 , 10 , 11}c.int x[4] = {{0,1,2,3}, {4,5,6,7}, {8,9,10,11}};d.None of the above

Select the valid statement to declare and initialize an array.1 point(a) int[] A = {}(b) int[] A = {1,2,3}(c) int[] A = (1,2,3)(d) int[][] A = {1,2,3}

Q3: Consider the two arrays C and D: int C[5]={1,5,2,3,4}; int D[3][4] = {{1,12,9,2},{11,5,3,4},{7,8,6,10}};The value of D[C[0]][C[1]] is:8Undefined1224

Suppose you have an array defined in the following way: int myArray[][] = {{16, 72}, {18, 24}, {5, 4}, {19, 3}}; What are the correct dimensions of this array?a.)2 x 4b.)4 x 2c.)8 x 1d.)3 x 3

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.