πŸ“’ Too many exams? Don’t know which one suits you best? Book Your Free Expert πŸ‘‰ call Now!


    Question

    Which of the following is a common technique used in

    debugging to systematically narrow down the location of a bug?
    A Writing more code. Correct Answer Incorrect Answer
    B Randomly changing variables. Correct Answer Incorrect Answer
    C Using print statements or a debugger to inspect variable values at different points. Correct Answer Incorrect Answer
    D Ignoring the error and hoping it resolves itself. Correct Answer Incorrect Answer
    E Reinstalling the operating system. Correct Answer Incorrect Answer

    Solution

    Inserting print statements (or logging) at various points in the code to display variable values, or using a debugger to set breakpoints and step through the code line by line while inspecting the state of variables, are fundamental and highly effective debugging techniques. They help understand the program's flow and identify where the state deviates from expectations.

    Practice Next
    ask-question