+ 2
Playground failed questions explainer
could there be a brief explanation of questions that we fail on playground, some are quite challenging and it will be nice if the answers are explained
8 Answers
+ 4
and yes Jim Mbatia you have missed to replace greater than operator in for loop condition
for ($i=0; $i<5; $i++)
Firstly 5025 is concatenate answer of a and b for in which a=50 and b=25 now that is because loop is running from 0 to 5 excluding 5 means for 0,1,2,3,4 means 5 time the loop will run and execute it body
$a is 0 initiallyn and when it goes inside the loop first time incremented by 10 so after 5 time going 10+10+10+10+10=50 that's why $a =50 same with $b goes 5 times in loop and increment by 5 five times so
$b= 5+5+5+5+5=25 so concatenate answer is 5025
after 5 times the loop condition will be false and out of the loop and print 5025 as output
I hope it is clear now have some đ đ
+ 5
You can put the code here or screenshot here and I'll answer for sure
You can upload screen shot on any online site like dropbox or drive then paste the link here
You will get the full explanation:-P
Have some đ đ đ
+ 3
Welcome :-D I'm honoured have some more đ đ đ ping me if you needed any help
+ 2
What is the output of this code?
$a=0;
$b=0;
For ($i=0; $i>5; $i++){
$a+=10;
$b+=5;
}
echo ("$a$b");
+ 2
You are the best
+ 1
Thanks Disha Ahuja for that reply.
I have now posted the question the answer is 5025 but I didn't get why
+ 1
Wow! Thanks I got it now
+ 1
Yeah it should be < DishaAhuja .
Thanks you