Create a two-dimensional array at runtime: Difference between revisions
Create a two-dimensional array at runtime (view source)
Revision as of 23:26, 5 April 2024
, 1 month agono edit summary
(Added various BASIC dialects (Chipmunk Basic, GW-BASIC, Minimal BASIC, MSX Basic and XBasic)) |
No edit summary |
||
Line 2,907:
33
</pre>
=={{header|Prolog}}==
{{works with|SWI Prolog}}
<syntaxhighlight lang="prolog">:- dynamic array/2.
run :-
write('Enter two positive integers, separated by a comma: '),
read((I,J)),
assert(array(I,J)),
Value is I * J,
format('a(~w,~w) = ~w', [I, J, Value]),
retractall(array(_,_)).</syntaxhighlight>
=={{header|Python}}==
|