|
Re: Trouble With Variables
I wouldn't be discouraged if I were you. As BrianK said, you are assigning floating-point values to an integer variable. Since you're new to programming, I'll explain that in more basic terms. A variable that is of type int must be assigned a whole-number value. Therefore, I would suggest changing "int x = 0.5" to "double x = 0.5". Also, "and" doesn't work in C++. Instead of "and", use "&&".
Hope this helps!
|