+ 2
Hi, Why the answer is 5 of the code below?
3 Respostas
+ 9
$i value will be vary 1 to 10 as use of the loop
${"a"."$i"} will make the number as $a1 to $a10 and you are priting the value of $a1+$a10-$a6 so this value is came by this condition
${"a"."$i"}=11-$i;
For $i = 1
$a1 =11-1 = 10
$a10 = 11-10 = 1
$a6 = 11-6 = 5
You are printing this value
echo $a1+$a10-$a6;
So output will be 10+1-5 = 11-5 = 6
So output is 6
+ 2
I found if we change $a6, the result is 6,
+ 2
Thank You very much, STEASY!