Function definition: Difference between revisions
no edit summary
No edit summary |
No edit summary |
||
Line 900:
S-BASIC is unusual in that the function return value is assigned to the END statement that terminates the function.
<syntaxhighlight lang="basic">
function multiply(a, b =
end = a * b
rem - exercise the function▼
print "The product of 9 times 3 is"; multiply(9, 3)▼
end▼
</syntaxhighlight>
{{out}}▼
<pre>▼
The product of 9 times 3 is 27▼
</pre>▼
==={{header|True BASIC}}===
Line 2,954 ⟶ 2,964:
end;
end;</syntaxhighlight>
▲rem - exercise the function
▲print "The product of 9 times 3 is"; multiply(9, 3)
▲end
▲{{out}}
▲<pre>
▲The product of 9 times 3 is 27
▲</pre>
=={{header|Scala}}==
|