Q#1: What is the main focus of Lecture No. 11 based on the given paragraph?
a) Linear Search
b) The Keyword βconstβ
c) Arrays
d) Copying Arrays
Answer: c) Arrays
Q#2: Why are arrays considered a possible solution to the problem of storing the ages of multiple students?
a) They occupy less memory
b) They require fewer variables
c) They allow storing data of the same type
d) They automatically calculate averages
Answer: c) They allow storing data of the same type
Q#3: In C language, what does the index of an array start from?
a) 1
b) 2
c) 0
d) The size of the array
Answer: c) 0
Q#4: What does the size of an array in C represent?
a) Memory occupied by the array
b) Number of elements in the array
c) Total number of arrays
d) Size of each element in the array
Answer: b) Number of elements in the array
Q#5: In the memory image of an array, what does “C[6]” represent?
a) The seventh element
b) The sixth element
c) The fifth element
d) The eighth element
Answer: a) The seventh element
Q#6: How is the memory occupied by an array visualized in the provided figure?
a) Disjointed areas
b) Random positions
c) Contiguous area
d) Circular arrangement
Answer: c) Contiguous area
Q#7: What is the significance of the value inside the square brackets when accessing an array element?
a) Element’s address
b) Element’s value
c) Element’s index
d) Element’s size
Answer: c) Element’s index
Q#8: Which statement accurately describes the relationship between array declaration and array usage?
a) Declaration refers to the whole array, and usage refers to a single element
b) Declaration refers to a single element, and usage refers to the whole array
c) Declaration and usage are the same
d) Declaration refers to the array’s size, and usage refers to its type
Answer: a) Declaration refers to the whole array, and usage refers to a single element
Q#9: How is the index of the last element of an array related to the size of the array?
a) Equal to the size of the array
b) One more than the size of the array
c) One less than the size of the array
d) Double the size of the array
Answer: c) One less than the size of the array
Q#10: What is the primary purpose of using a ‘for loop’ to input values into an array?
a) To access the whole array
b) To calculate the average age
c) To initialize the array
d) To manipulate array elements
Answer: c) To initialize the array
Q#11: What is the loop condition in the ‘for loop’ used for inputting student ages?
a) i > 10
b) i == 10
c) i < 10
d) i >= 10
Answer: c) i < 10
Q#12: What does the loop body do in the ‘for loop’ used for inputting student ages?
a) Prints the student’s age
b) Calculates the average age
c) Reads and stores the student’s age
d) Prints a message to the console
Answer: c) Reads and stores the student’s age
Q#13: How is the total age calculated using a ‘for loop’?
a) Subtracting each element from the totalAge
b) Multiplying each element with the totalAge
c) Adding each element to the totalAge
d) Dividing each element by the totalAge
Answer: c) Adding each element to the totalAge
Q#14: Why is it advised not to use the default initialization of arrays?
a) It leads to a compilation error
b) It may assign random values to the array
c) It increases memory consumption
d) It prevents the array from being accessed
Answer: b) It may assign random values to the array
Q#15: What is the purpose of the ‘loop’ mentioned in the context of initializing an array?
a) To print array elements
b) To assign values to array elements
c) To calculate the average of the array
d) To check array size
Answer: b) To assign values to array elements
Q#16: How are arrays declared without specifying their size at declaration time?
a) By using a ‘loop’
b) By using the ‘const’ keyword
c) By declaring multiple variables in a single line
d) By using dynamic memory allocation
Answer: d) By using dynamic memory allocation
Q#17: In the given example, what does “age[5]” represent?
a) The sixth element of the array
b) The fifth element of the array
c) The fourth element of the array
d) The second element of the array
Answer: b) The fifth element of the array
Q#18: What is the significance of the loop condition “i < 10” in the ‘for loop’ used to calculate the total age?
a) It ensures the loop runs 10 times
b) It prevents accessing the array out of bounds
c) It checks if the array is empty
d) It initializes the loop variable
Answer: a) It ensures the loop runs 10 times
Q#19: What is the variable used to accumulate the total age in the ‘for loop’ calculating the total age?
a) age
b) totalAge
c) i
d) sum
Answer: b) totalAge
Q#20: How is the average age calculated after obtaining the total age?
a) Dividing totalAge by the number of students
b) Multiplying totalAge by the number of students
c) Subtracting the minimum age from totalAge
d) Adding 1 to totalAge
Answer: a) Dividing totalAge by the number of students