Problem: I have IF statement if (x == 180 || x == 360 || x == 540
and so on
How can I keep that list going without writing 180 + 180 * n
all out?
Extra info: i want to print "doesnt exist" if sin(x * M_PI / 180) is 0. It is 0 when sin(180), sin(360) and so on.
EDIT: i've tried sin(x2 * M_PI / 180) == 0
but it doesnt work (probably because its close to 0 but not 0)
use modulo operand : %
if (x>0 && x%180==0) {..}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With