Functions | Sololearn: Learn to code for FREE!

-5

Functions

What output results from the following code? function func($arg) { $result = 0; for($i=0; $i<$arg; $i++) { $result = $result + $i; } return $result; } echo func(5);

12/30/2016 9:48:29 PM

Renice Owino

14 Answers

New Answer

+14

Aaaand for the word of the day: https://www.urbandictionary.com/define.php?term=Necroposting

+8

Lord Krishna too late... just gave the badge to rei.... ;) (rip)

+7

10!! ^_^ (really guys?? cant you see that the question has already been answered?? why spam?)

+5

+4

Valen.H. ~ They aren't spamming, no answer has received the best mark (yet). They are trying for best mark, worth 10xp at best šŸ˜Ž.

+4

Mirror mirror on the wall, Who's the greatest necromancer of them all? sanaka kavitha was the greatest in this hall, But now Houcem Eddine Aouissaoui is the greatest of them all! Houcem Eddine Longest-name-ever: Check the posting date _unless_ you have something _new_ to offer. Otherwise I'm with with Valen & Rei on this one: it's just another type of spamming. Sorry L.K. but, "A rose by any other name..." Is still a darn rose! ...and can still end with you receiving a prick that evening!

+3

Lol, i thought it was me and my hand slipped XD

+1

+1

can someone please explain why it is 10? for every time the number is smaller then 5 add + 1? and then at the end add the 5 ? which makes 10... if this is a reasonable explanation ?

+1

output results from the following code? function func($arg) { $result = 0; for($i=0; $i<$arg; $i++) { $result = $result + $i; } return $result; } echo func(5); 10

0

0

0

0

Your post is too amazing. I have found with ease what I was looking for. Moreover, the content quality is awesome. Thanks for the nudge! https://www.dumpscafe.com/Braindumps-8006.html