I am running the below program :
#include <iostream>
using namespace std;
int main()
{
while(1)
{
int a;
cin >> a;
cout << 9/a << endl;
}
return 0;
}
the step by step process is
- the above code gets compiled and successively converted into binary fotmat.
- the binary code instructions get executed step by step.
so when I provide the input with : 0, I receive following on the console : Floating point exception: 8
Now my question is how does this "Floating point exception: 8" gets printed on console when machine is executing binary instructions.