Skip to content

Instantly share code, notes, and snippets.

@cetint
Last active October 12, 2015 07:38
Show Gist options
  • Save cetint/3993181 to your computer and use it in GitHub Desktop.
Save cetint/3993181 to your computer and use it in GitHub Desktop.
ABAP-Fibonacci(EN)
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