Program:
REPORT ZSM_CALCULATOR_TWO.parameters: p_a TYPE int4.
parameters: p_b TYPE int4.
PARAMETERS: p_sign TYPE char1.
DATA: lv_add TYPE int4.
DATA: lv_sub TYPE int4.
DATA: lv_mul TYPE int4.
DATA: lv_div TYPE int4.
if p_sign = '+'.
lv_add = p_a + p_b.
write: 'The addition is: ', lv_add.
ENDIf.
if p_sign = '-'.
lv_sub = p_a - p_b.
write: 'The substraction is: ', lv_sub.
ENDIF.
if p_sign = '*'.
lv_sub = p_a * p_b.
write: 'The substraction is: ', lv_sub.
ENDIF.
if p_sign = '/'.
lv_sub = p_a / p_b.
write: 'The substraction is: ', lv_sub.
ENDIF.
Output:
0 Comments