Generic swap: Difference between revisions
Content added Content deleted
m (added a ;Task: (bold) header, added other whitespace to the task's preamble.) |
No edit summary |
||
Line 744: | Line 744: | ||
[b,a] = [a,b] |
[b,a] = [a,b] |
||
</lang> |
</lang> |
||
={{header|FutureBasic}}== |
|||
<lang futurebasic> |
|||
include "ConsoleWindow" |
|||
dim as long i, j |
|||
dim as double x, y |
|||
dim as Str15 a, b |
|||
i = 1059 : j = 62 |
|||
print i, j |
|||
swap i, j |
|||
print i, j |
|||
print |
|||
x = 1.23 : y = 4.56 |
|||
print x, y |
|||
swap x, y |
|||
print x, y |
|||
print |
|||
a = "Hello" : b = "World!" |
|||
print a, b |
|||
swap a, b |
|||
print a, b |
|||
</lang> |
|||
Output: |
|||
<pre> |
|||
1059 62 |
|||
62 1059 |
|||
1.23 4.56 |
|||
4.56 1.23 |
|||
Hello World! |
|||
World! Hello |
|||
</pre> |
|||
=={{header|Gecho}}== |
=={{header|Gecho}}== |