#include <STDIO.H>
int main()
{
// double num = 1.0 / 0.0 ;//error C2124: divide or mod by zero
// printf("%lf",num);
// double num = 1.0 / 0; //error C2124: divide or mod by zero
// printf("%lf",num);
// double num = 0.0 / 0.0; // error C2124: divide or mod by zero
// printf("%lf",num);
int i = 1 / 0; //error C2124: divide or mod by zero
printf("%d",i);
return 0;
}
以上是在vc6.0中除数为零的验证。