Computer Science Canada calculator error |
Author: | con.focus [ Thu Dec 02, 2004 6:15 pm ] | ||
Post subject: | calculator error | ||
im making a calculator simple though every time when usinmg the divison function and the secound number is 0 is outputs an error ne way i can beat the programm to it by tell is to exit the function and output an error message if the secound number is 0 and the function being used is division here's my code
|
Author: | Mazer [ Thu Dec 02, 2004 6:21 pm ] | ||
Post subject: | |||
Just check to make sure that inum2 isn't equal to 0. If it's zero and they choose '/' then just don't do the operation. Try this in your if statement:
|
Author: | con.focus [ Thu Dec 02, 2004 6:36 pm ] |
Post subject: | |
thx alot man i had to change a bit but the right idea i needed |