C Programming-Multidimensional Arrays
Question 1
|
What is the output of this C code?
1 2 3 4 5 0
| |
1 2 3 4 5 junk
| |
1 2 3 4 5 5
| |
Run time error
|
Question 2
|
What is the output of this C code?
1 2 3 junk 4 5
| |
Compile time error
| |
1 2 3 0 4 5
| |
1 2 3 3 4 5
|
Question 3
|
What is the output of this C code?
0 3 0 0 0 0
| |
Junk 3 junk junk junk junk
| |
Compile time error
| |
All junk values
|
Question 4
|
What is the output of this C code?
0 3 0 0 0 0
| |
Junk 3 junk junk junk junk
| |
Compile time error
| |
All junk values
|
Question 5
|
What is the output of this C code?
0 3 0 0 0 0
| |
Junk 3 junk junk junk junk
| |
Compile time error
| |
All junk values
|
Question 6
|
Comment on the following statement: int (*a)[7];
An array “a” of pointers.
| |
A pointer “a” to an array.
| |
A ragged array.
| |
None of the mentioned
|
Question 7
|
Comment on the 2 arrays regarding P and Q: int *a1[8]; int *(a3[8]); P. Array of pointers Q. Pointer to an array
a1 is P, a2 is Q
| |
a1 is P, a2 is P
| |
a1 is Q, a2 is P
| |
a1 is Q, a2 is Q
|
Question 8
|
Which of the following is not possible statically in C?
Jagged Array
| |
Rectangular Array
| |
Cuboidal Array
| |
Multidimensional Array
|
Question 9
|
What is the correct syntax to send a 3-dimensional array as a parameter? (Assuming declaration int a[5][4][3];)
func(a);
| |
func(&a);
| |
func(*a);
| |
func(**a);
|
Question 10
|
Applications of multidimensional array are?
Matrix-Multiplication
| |
Minimum Spanning Tree
| |
Finding connectivity between nodes
| |
All of the mentioned
|
Question 11
|
What is the output of this C code?
2 2
| |
Compile time error
| |
Undefined behaviour
| |
10 2
|
Question 12
|
What is the output of this C code?
Compile time error
| |
10 2
| |
Undefined behaviour
| |
segmentation fault/code crash
|
Question 13
|
What is the output of this C code?
10
| |
2
| |
Compile time error
| |
Undefined behaviour
|
Question 14
|
What is the output of this C code?
Compile time error
| |
20
| |
Address of j
| |
Undefined behaviour
|
Question 15
|
What is the output of this C code?
Compile time error
| |
4
| |
1
| |
2
|
Check Your Answers:
1. A
2. B
3. A
4. C
5. C
6. B
7. B
8. A
9. A
10. D
11. A
12. A
13. D
14. A
15. A
0 comments:
Post a Comment