Question
A function sum_matrix_elements(matrix, R, C) is designed
to sum all elements of a matrix with R rows and C columns. The implementation uses nested loops: total_sum = 0 for i in range(R + 1): # Potential bug here   for j in range(C + 1): # Potential bug here     total_sum += matrix[i][j] Assuming R and C represent the actual number of rows and columns (e.g., R=3 for 3 rows), what kind of error will this code cause?Solution
The correct answer is C
How many dimensions are selected in dice operation?
What is the maximum number of different Boolean functions involving n Boolean variables?
What is the primary goal of cybersecurity?
In error detection, what is the purpose of a checksum?
Which OWASP Top 10 vulnerability involves exploiting the lack of proper input validation and output encoding to inject malicious scripts into web pages...
What is the time complexity of a dynamic programming solution for a problem with "n" subproblems and each subproblem taking "O(1)" time to solve?
Which of the following is NOT a potential concurrency control issue?
Which layer of the OSI model deals with electrical, mechanical, and physical aspects of data transmission?
Type-checking is normally done during
Which of the following is the primary fuel used in natural gas power plants?