Floating Exception (core dumped)

I am a student and have a relatively straight forward program for calculating sales totals, tax discounts, and another discount.

I compile without any errors but after I enter the tax rate, discount rate and discount qty I get the error:  Floating Exceptin (core dumped).  Is there a simple solution to this that I am unaware of?

Thank you
delousedAsked:
Who is Participating?
 
brettmjohnsonCommented:
Floating point exceptions typically occur when you attempt to divide by 0.
Just before you perform a floating point division operation, print out the divisor and dividend - make sure they are the values you expect.   You could also run the program from the debugger.  When the floating point exception occurs, the debugger will halt the program at the point of failure.  You can then examine the contents of variables to make sure they have the expected values.

0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.