0
why this Program dont work ?
why this Program dont work ? there is no Output <?php $tarek=27; if ($tarek<=20){ echo "grand"; } elseif ($tarek>20 && $tarek<25) {echo "il faut saccelerer "; } else { "parfait"; } ?>
8 Answers
+ 1
You are not echoing 'parfait'.
+ 1
haha ah ok thinks, my god i did not sow the echo
+ 1
ALSO:
$tarek is 27 which is out of range as well:
equal or less than 20
greater than 20 and less than 25
+ 1
No I need to make >20 to see if the value are in the interval {20,25} , at the first else are not <= 20 so in elseif >20 than is < 25 or not
+ 1
The value is
0
No the program can run , I forgot only the echo at the last element.
0
Yes, just pointing out the range, 27, being outside. I see it works. But you don't need the >20 bit on the elseif, it falls through from first if :)
0
Will an example help?
https://code.sololearn.com/c1vtphKl8Rfj/?ref=app
(it's C++ but PHP structure works the same AFAIK)