update
This commit is contained in:
parent
1f1ad49427
commit
6f050a029e
2496 changed files with 37609 additions and 3031 deletions
26
Task/Loops-Break/COBOL/loops-break.cobol
Normal file
26
Task/Loops-Break/COBOL/loops-break.cobol
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
IDENTIFICATION DIVISION.
|
||||
PROGRAM-ID. Random-Nums.
|
||||
|
||||
DATA DIVISION.
|
||||
WORKING-STORAGE SECTION.
|
||||
01 Num PIC Z9.
|
||||
|
||||
PROCEDURE DIVISION.
|
||||
Main.
|
||||
PERFORM FOREVER
|
||||
PERFORM Generate-And-Display-Num
|
||||
|
||||
IF Num = 10
|
||||
EXIT PERFORM
|
||||
ELSE
|
||||
PERFORM Generate-And-Display-Num
|
||||
END-IF
|
||||
END-PERFORM
|
||||
|
||||
GOBACK
|
||||
.
|
||||
|
||||
Generate-And-Display-Num.
|
||||
COMPUTE Num = FUNCTION REM(FUNCTION RANDOM * 100, 20)
|
||||
DISPLAY Num
|
||||
.
|
||||
16
Task/Loops-Break/Erlang/loops-break.erl
Normal file
16
Task/Loops-Break/Erlang/loops-break.erl
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
%% Implemented by Arjun Sunel
|
||||
-module(forever).
|
||||
-export([main/0, for/0]).
|
||||
|
||||
main() ->
|
||||
for().
|
||||
|
||||
for() ->
|
||||
K = random:uniform(19),
|
||||
if K==10 ->
|
||||
io:format("~p~n",[K]);
|
||||
true ->
|
||||
M = random:uniform(19),
|
||||
io:format("~p~n",[M]),
|
||||
for()
|
||||
end.
|
||||
Loading…
Add table
Add a link
Reference in a new issue