Function definition: Difference between revisions

Add SmallBASIC
(→‎{{header|langur}}: modified to suit task description)
(Add SmallBASIC)
 
Line 1,022:
The product of 9 times 3 is 27
</pre>
 
==={{header|SmallBASIC}}===
<syntaxhighlight lang="qbasic">
func multiply(a, b)
return a * b
end
 
print "2 * 3 = "; multiply(2, 3)
</syntaxhighlight>
 
If function definition is only one line, <code>def</code> can be used:
<syntaxhighlight lang="qbasic">
def multiply(a, b) = a * b
print "2 * 3 = "; multiply(2, 3)
</syntaxhighlight>
 
 
==={{header|True BASIC}}===
26

edits