Debugging Techniques MCQs – Part 1

Timer: Off
Random: Off

1. What is the purpose of using a debugger in C programming?
ⓐ. To compile the code
ⓑ. To identify and fix errors in the code
ⓒ. To write code faster
ⓓ. To enhance code readability
2. Which of the following is a common debugging tool for C programs?
ⓐ. GDB
ⓑ. Photoshop
ⓒ. Eclipse
ⓓ. Microsoft Word
3. What is the term for a programming error that causes a program to crash or produce incorrect results?
ⓐ. Compiler error
ⓑ. Logical error
ⓒ. Runtime error
ⓓ. Syntax error
4. Which optimization technique involves improving the efficiency of loops in a program?
ⓐ. Loop unrolling
ⓑ. Inline expansion
ⓒ. Constant folding
ⓓ. Code motion
5. What does the term “profiling” refer to in the context of program optimization?
ⓐ. Writing code documentation
ⓑ. Measuring the performance of a program
ⓒ. Debugging syntax errors
ⓓ. Refactoring code
6. Which compiler optimization level provides the most aggressive optimizations in GCC?
ⓐ. -O0
ⓑ. -O1
ⓒ. -O2
ⓓ. -O3
7. What is the purpose of the “valgrind” tool in C programming?
ⓐ. Compiling code
ⓑ. Debugging code
ⓒ. Detecting memory leaks
ⓓ. Writing documentation
8. Which type of error is the most difficult to debug in C programming?
ⓐ. Syntax error
ⓑ. Logical error
ⓒ. Runtime error
ⓓ. Compilation error
9. What is the benefit of using “assert” statements in C code?
ⓐ. To improve code readability
ⓑ. To enforce code formatting standards
ⓒ. To catch errors during development
ⓓ. To optimize code execution
10. Which optimization technique involves replacing a function call with the function’s code to reduce overhead?
ⓐ. Loop unrolling
ⓑ. Inline expansion
ⓒ. Dead code elimination
ⓓ. Constant propagation
Subscribe
Notify of
guest
1000


0 Comments
Inline Feedbacks
View all comments
0
Join Discussionsx
()
x