What will be the result of executing following code?
$k = 0;
$p = 0;
for($i = 0 ; $i < 3 ; $i++) 
    $k += $i; 
echo $k; 
 
for($i = 0 ; $i < 3 ; ++$i) 
    $p += $i; 
echo $p; 
Explanation
Get an explanation when it's available:

Follow CodeGalaxy

Mobile Beta

Get it on Google Play
Send Feedback
Keep exploring
PHP quizzes
Cosmo
Sign Up Now
or Subscribe for future quizzes