Function definition: Difference between revisions
no edit summary
(Replace println() with print(); replace output "syntaxhighlight" tag with "pre" tag) |
No edit summary |
||
Line 2,954:
end;
end;</syntaxhighlight>
=={{header|S-BASIC}}==
S-BASIC is unusual in assigning the return value of a function to its terminating END.
<syntaxhighlight lang="basic">
rem - return the product of two integers
function multiply(a, b = integer) = integer
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|Scala}}==
|