#include #include void crash_demo() { int *ptr = NULL; // Initialize a pointer to NULL // Attempting to dereference a NULL pointer (this causes a segmentation fault) *ptr = 42; // Crash here, ptr is NULL printf("Value at ptr: %d\n", *ptr); // This will not be executed } int main() { printf("Program started\n"); crash_demo(); // Call the function that will crash printf("This line won't be printed due to the crash\n"); return 0; }