/*
* demonstrate what happens when you divide by 0
*
* Matt Bishop, ECS 36A
* April 4, 2024 original version
*/
#include <stdio.h>
int 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 2, 2024 at 12:13PM
|
You can get the raw source code here. |