Arrays
- What will be the output of the following C code?
#include <stdio.h>
int main()
{
int n[2][3];
function(n);
}
void function(int *n[])
{
int num1 = 20, num2 = 23, L;
n[0] = &num1;
n[1] = &num2;
*n[0] = 23;
for (L = 0; L < 2; L++)
printf("%d\n", *n[L]);
}
-
View Hint View Answer Discuss in Forum
NA
Correct Option: C
23
23
- What are the applications of a multidimensional array?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: D
Minimum Spanning Tree, Finding connectivity between nodes, and Matrix-Multiplication are the applications of a multidimensional array.
- What is the correct syntax to send a 3-dimensional array as a parameter? (Assuming declaration int number[4][3][2];)
-
View Hint View Answer Discuss in Forum
NA
Correct Option: D
func(number);
- Which of the following is not possible statically in C?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: B
Jagged Array
- Comment on the following 2 arrays with respect to I and II.
int *num1[10];
int *(num2[10]);
I. Array of pointers
II. Pointer to an array
-
View Hint View Answer Discuss in Forum
NA
Correct Option: D
num1 is I, num2 is I