domingo, 25 de enero de 2015
Factorial de un número ABAP
*&---------------------------------------------------------------------*
*& Report ZPROGR_01
*&
*&---------------------------------------------------------------------*
*&
"Factorial de un numero
*&---------------------------------------------------------------------*
REPORT ZPROGR_01.
DATA: N1 TYPE I,
N3 TYPE I.
DATA: AUX TYPE I.
N1 = 1.
SELECTION-SCREEN: BEGIN OF BLOCK B01 WITH FRAME TITLE TEXT-001.
PARAMETERS: N2 TYPE I.
SELECTION-SCREEN: END OF BLOCK B01.
N3 = N2.
WHILE N3 > 1.
N1 = N3 * ( N3 - 1 ) * N1.
N3 = N3 - 2.
ENDWHILE.
WRITE: 'El factorial de : ' , N2 .
WRITE:/ N1.
Suscribirse a:
Enviar comentarios (Atom)
gracias
ResponderEliminar