This forum is now read-only. Please use our new forums at discuss.codecademy.com.

For Loops in PHP Forum

View Course » View Exercise

213 points
518d6ba83d0a8161280023bd_490865321
Submitted by
its_aNYthing
over 4 years ago

what is wrong with this code?

for ($i = 50; $i > 5; $i = $i - 5)
{
echo $i;
}


0 votes

permalink

Your for loop will only run as long as $i is greater than 5. It needs to include 5 though, so change your second argument to $i >= 5;

583 points
51830bd041612a5b1a000fda_403063692
Submitted by
verycleanteeth
over 4 years ago