Last active
October 12, 2015 07:38
-
-
Save cetint/3993181 to your computer and use it in GitHub Desktop.
ABAP-Fibonacci(EN)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
REPORT zfibonacci_10. | |
DATA : lv_old TYPE i VALUE 1 , | |
lv_current TYPE i VALUE 2 , | |
lv_next TYPE i . | |
WRITE 'First 10 elements of Fibonacci series : ' . | |
WRITE : lv_old, lv_current . | |
DO 8 TIMES. | |
lv_next = lv_old + lv_current . "3 = 1 + 2 | |
WRITE lv_next . "3 | |
lv_old = lv_current . "lv_old = 2 | |
lv_current = lv_next . "lv_current = 3 | |
ENDDO. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment