I can't seem to find the error in my php code
I passed the first two stages correctly, but in the 3rd stage (final stage) I keep getting an error. What is wrong with the code?
Please help me.
<?php //Place your code below this comment $integerOne = 1; $integerTwo = 2; $floatOne = 1.5; echo($integerOne += 5); echo($integerTwo --); echo($integerOne * $floatOne); ?>
Jennifer NordellTreehouse Staff
Hi there, Mostafa Alhosain ! The problem lies in the output. As Molly James has noted there are two extraneous
echo statements. There should only be one echo statement and it should be the last one you have.
If you check under "preview" with your current code, you'll note that it's printing out "629". The first echo statement prints out 6. The next, 2 and the next prints 9. But it's expecting to only see "9" printed
echo from around the
$integerOne += 5 and
$integerTwo-- will result in the correct output.
Hope this helps!
Molly James18,382 Points
There's no need for the echo statements on your second stage. By adding them, the second call to the variable refers back to the previous declaration, in this case the first line.