Function definition: Difference between revisions
Content added Content deleted
Langurmonkey (talk | contribs) (→{{header|langur}}: modified to suit task description) |
(Add SmallBASIC) |
||
Line 1,022: | Line 1,022: | ||
The product of 9 times 3 is 27 |
The product of 9 times 3 is 27 |
||
</pre> |
</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}}=== |
==={{header|True BASIC}}=== |