4.2.1 - introduction to function, Definition and their Prototypes.
1. How are multidimensional arrays stored in memory?
Correct Answer: (A) Row-major order
2. What is the basic type of multiple dimensions array in C?
Correct Answer: (A) 2D array
3. Which of the following is true about a 2D array in C?
Correct Answer: (A) A distinct 1D array can represent each element
4. How many loops are needed to traverse a 2D array in C?
Correct Answer: (B) 2
5. Which matrix is called a rectangle matrix in a 2D array?
Correct Answer: (C) When rows and columns differ
6. What is the valid declaration for a 2D array?
Correct Answer: (C) int array[3][4];
7. What is the default return type of a C function?
Correct Answer: (A) int
8. Which of the following does not return any value?
Correct Answer: (A) Procedure
9. What is stored in a stack before calling a function?
Correct Answer: (B) Return address
10. Which of the following components form a function declaration?
Correct Answer: (A) Return type, name, parameters
11. What is the correct way to declare a 2D array without specifying the row size?
Correct Answer: (A) int array[][3];
12. Which of the following will update an element in a 2D array?
Correct Answer: (B) Scan and replace via loops
13. What is the advantage of using functions in C?
Correct Answer: (B) Efficient memory allocation
14. Which function prototype is valid in C?
Correct Answer: (D) All of the above
15. Which of the following allows functions to be reused in C?
Correct Answer: (C) Function calls
16. What is a key benefit of subprograms?
Correct Answer: (C) Reduces code repetition
17. Which of the following is incorrect about 2D array declaration?
Correct Answer: (B) int array[][] = {1,2,3};
18. Which operation is performed first when a function is called?
Correct Answer: (D) Return address stored
19. What is matrix multiplication in C?
Correct Answer: (B) Multiplying row of one matrix with column of another
20. How many loops are needed for matrix multiplication?
Correct Answer: (C) 3