Skip to content

Instantly share code, notes, and snippets.

@larshp
Created December 6, 2016 13:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save larshp/dac5de3fcfca7d1155748653deb6dee0 to your computer and use it in GitHub Desktop.
Save larshp/dac5de3fcfca7d1155748653deb6dee0 to your computer and use it in GitHub Desktop.
DATA: lv_data TYPE string,
lv_int TYPE i VALUE 38.
WHILE lv_int <> 0.
IF lv_int MOD 2 = 0.
CONCATENATE '0' lv_data INTO lv_data.
ELSE.
CONCATENATE '1' lv_data INTO lv_data.
ENDIF.
lv_int = lv_int DIV 2.
ENDWHILE.
WRITE: / lv_data.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment