Floating point exception (core dumped)
The program performed an invalid floating-point operation, such as division by zero.
int main() { int a = 10; int b = 0; int result = a / b; // Division by zero return 0; }
Check for zero values before performing division or modulo operations.
#include <stdio.h> int main() { int a = 10; int b = 0; int result; if (b != 0) { result = a / b; } else { printf("Error: Division by zero\n"); result = 0; // Or some other appropriate value } return 0; }