OUTPUT | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

OUTPUT

What output results from the following code? $x = 6; if ($x == 10) { echo "A"; } elseif ($x > 7 && $x < 10) { echo "B"; } elseif ($x == 20) { echo "C"; } else { echo "D"; }

12th Jul 2017, 3:49 AM
Sulav Maharjan
Sulav Maharjan - avatar
7 Answers
+ 1
It would be D as the other conditions are false.
12th Jul 2017, 4:00 AM
G.S.N.V. Suraj
G.S.N.V. Suraj - avatar
+ 1
D
14th Jul 2017, 2:11 AM
Vinay
Vinay - avatar
+ 1
d
27th Dec 2018, 5:08 PM
kenny George
kenny George - avatar
+ 1
D
15th Sep 2019, 10:59 PM
ISINGIZWE GASANA Aline
ISINGIZWE GASANA Aline - avatar
+ 1
d
10th Oct 2019, 12:08 PM
Takudzwa Kangata
Takudzwa Kangata - avatar
+ 1
d
7th Dec 2021, 6:05 PM
Medhat Mohamed Ibrahim Abu Mandour
Medhat Mohamed Ibrahim Abu Mandour - avatar
0
D is the correct answer that the 10 is different from 6 and second 7 is greater and the 6 is less than 10 but with the and operation it is false
15th Aug 2022, 5:36 PM
Lemmessa Welfana
Lemmessa Welfana - avatar