add: more samples and make them work
This commit is contained in:
18
samples/fizzbuzz.rpg
Normal file
18
samples/fizzbuzz.rpg
Normal file
@@ -0,0 +1,18 @@
|
||||
**FREE
|
||||
Ctl-Opt Main(FizzBuzz);
|
||||
|
||||
Dcl-Proc FizzBuzz;
|
||||
Dcl-S num Int(10);
|
||||
|
||||
For num = 1 To 100;
|
||||
If %Rem(num:3) = 0 And %Rem(num:5) = 0;
|
||||
Dsply ('num - ' + %Char(num) + ' FIZZBUZZ');
|
||||
ElseIf %Rem(num:3) = 0;
|
||||
Dsply ('num - ' + %Char(num) + ' FIZZ');
|
||||
ElseIf %Rem(num:5) = 0;
|
||||
Dsply ('num - ' + %Char(num) + ' BUZZ');
|
||||
Else;
|
||||
Dsply ('num - ' + %Char(num));
|
||||
EndIf;
|
||||
EndFor;
|
||||
End-Proc FizzBuzz;
|
||||
Reference in New Issue
Block a user