/* * demonstrate what happens when you divide by 0 * * Matt Bishop, ECS 36A * April 4, 2024 original version */ #includeint main(void) { int x = 0; /* divisor */ /* divide 100 by 0 and print the result */ x = 100/x; /* you never get here; it crashes */ printf("%d\n", x); /* say goodnight! */ return(0); }
|
ECS 36A, Programming & Problem Solving Version of April 8, 2024 at 9:31AM
|
You can get the raw source code here. |