Can someone tell me why the output of echo
of this Code is 13?
$a=10;
$b=2;
$j=$a/2;
for ($i=0;$i<$j;$i++){
if ($i % $b == 1)
echo "$i";
}
$a=10;
$b=2;
$j=$a/2; //which will be 5
for ($i=0;$i<$j;$i++){ //the loop executes 5 times
if ($i % $b == 1) // this condition satisfies when $i becomes 1 && 3
echo "$i"; //1 and 3 will be printed.
}
Check The comments written in your code