QP School

Full Version: Debugging techniques and tools in C
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Debugging helps identify and fix errors in the code.

#include <stdio.h>

int main() {
    int x = 10, y = 0;
    int result = x / y; // Division by zero
    printf("Result: %d\n", result); // Causes a runtime error (division by zero)
    return 0;
}