I keep getting a compiler error saying "invalid operands of types . . ."
I'm trying to get the program to return the value of how many factors of 2 are in 12 (later this will be changed to an input number).
Thanks for any help.
The error is more than likely on line 11. You can not use the modulus operator on floating-point numbers. It is used for integers only. If you wish to get the remainder after division for floating-point you must use fmod[1]. Keep in mind though if you do this you may want to range to compare since you shouldn't compare floating-points like that. Floating-points are stored much differently than integers. http://www.cplusplus.com/reference/cmath/fmod/