Question: Given the declarations below representing 5x4 2D arrays, select all of the statements that will set the 3rd row, 4th element of the arrays to
Given the declarations below representing 5x4 2D arrays, select all of the statements that will set the 3rd row, 4th element of the arrays to 5.
![int numbers1[5] [4]; int * numbers2 = malloc (5*4*sizeof(int)); int ** numbers3](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2022/08/6308a55a60b23_0026308a55a49c91.jpg)
- numbers 1 [2] [3] = 5;
- numbers 2 [2 * 4 + 3] = 5;
- numbers 3 [2] [3] = 5;
- numbers 1 [2 x 4 + 3] = 5;
- numbers 2 [2][3] = 5;
- numbers 3 [2 * 4 + 3] = 5;
int numbers1[5] [4]; int * numbers2 = malloc (5*4*sizeof(int)); int ** numbers3 = malloc (5 * sizeof(int *)); for (int r = 0; r < 5; r++) { numbers3[r] malloc(4 *sizeof(int)); }
Step by Step Solution
3.42 Rating (161 Votes )
There are 3 Steps involved in it
To set the 3rd row and 4th element of the arrays to 5 lets examine each statement 1 numbe... View full answer
Get step-by-step solutions from verified subject matter experts
