Online Tutorials & Training Materials | STechies.com
Register Login
Advertisement

Factorial for 1 to 5 numbers, ABAP program.

|| 0

Factorial for 1 to 5 numbers, ABAP program.
Stechies

ABAP PROGRAM SHOWING FACTORIAL FOR 1 TO 5 NUMBERS.

REPORTĀ  yfactorial_prathyusha.
DATA: n1 TYPE i VALUE 5,
n2 TYPE i,
fact TYPE i VALUE 1.
DO 5 TIMES.
N2 = N1.
WHILE N2 >= 1.
FACT = FACT * N2.
N2 = N2 - 1.
ENDWHILE.
WRITE: / 'FACTORIAL OF: ' , N1 ,FACT.
FACT = 1.
N1 = N1 - 1.
ENDDO.


Advertisement
Advertisement