yay my internet works again
Anyway---- How do I make my program check if the result of a calculation is an integer or not and if it isnt then display an error?
Printable View
yay my internet works again
Anyway---- How do I make my program check if the result of a calculation is an integer or not and if it isnt then display an error?
Define a int variable.
Then set the ints value to the value of the variable you want to check, after that compare the two values. If the value is not an integer, they will not be the same.
This code will give you a warning such as: "warning: converting from 'double' to 'int', possible loss of data." or such.