<?php function calculate($n) { $result = 0; for ($i = 1; $i <= $n; $i++) { for($j = 1; $j <= $i; $j++) { $result += 1; } } return $result; } var_dump(calculate(2));
You have javascript disabled. You will not be able to edit any code.