Thnx for suggesting. Are you saying that it should give infinity on dividing with zero?
That's entirely up to you. You can make it so it refuses the operands and displays an error or you can make it return infinity. In any case, with the current code, the behavior when dividing by 0 is not what you can expect.
Actually on dividing by zero it is giving infinity as an output check it on compiler version gcc 6.3.0
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Thnx for suggesting. Are you saying that it should give infinity on dividing with zero?
That's entirely up to you. You can make it so it refuses the operands and displays an error or you can make it return infinity.
In any case, with the current code, the behavior when dividing by 0 is not what you can expect.
Actually on dividing by zero it is giving infinity as an output check it on compiler version gcc 6.3.0