CLS
a = 7
FOR i = 1 TO 10
PRINT a;
IF a MOD 2 = 0 THEN
a = a \ 2
a = 7
FOR i = 1 TO 10
PRINT a;
IF a MOD 2 = 0 THEN
a = a \ 2
END IF
NEXT i
END
NEXT i
END
Series Using SUB Procedure
DECLARE SUB series()
CALL series
END
SUB series
a = 7
FOR i = 1 TO 10
PRINT a;
IF a MOD 2 = 0 THEN
a = a \ 2
CALL series
END
SUB series
a = 7
FOR i = 1 TO 10
PRINT a;
IF a MOD 2 = 0 THEN
a = a \ 2
ELSE
a = a * 3 + 1
a = a * 3 + 1
END IF
NEXT i
END SUB
NEXT i
END SUB
Series Using FUNCTION Procedure
DECLARE FUNCTION series()
s = series
END
FUNCTION series
a = 7
FOR i = 1 TO 10
PRINT a;
IF a MOD 2 = 0 THEN
a = a \ 2
s = series
END
FUNCTION series
a = 7
FOR i = 1 TO 10
PRINT a;
IF a MOD 2 = 0 THEN
a = a \ 2
ELSE
a = a * 3 + 1
a = a * 3 + 1
END IF
NEXT i
END FUNCTION
NEXT i
END FUNCTION
No comments:
Post a Comment
If you have any doubts, Please let me know.