Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

division

Status
Not open for further replies.

soodvarun

Programmer
Apr 21, 2001
40
CA
main()
{
int k=100/0;
printf("%d",k);
}

WHY IS THE OUTPUT 100
 
This program should blow up- you can't divide by zero, this is simply not allowed.
 
Hi:

The response you get in a division my 0 will depend on the compiler. On my SCO Unix compiler, I get a division by 0 warning at compile time, and a floating point exception at run time.

Regards,

Ed
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top