Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- *&---------------------------------------------------------------------*
- *& Report Y_GRIGORE_LAB5
- *&
- *&---------------------------------------------------------------------*
- *&
- *&
- *&---------------------------------------------------------------------*
- REPORT Y_GRIGORE_LAB5.
- DATA int TYPE I.
- int = 10.
- DATA float TYPE F.
- float = '1.234'.
- Data ari TYPE D.
- ari = '20190307'.
- DATA ora TYPE T.
- ora = '103719'.
- DATA nume TYPE C.
- nume = 'GRIGORE'.
- WRITE: int, / float, / ari ,/ ora ,/ nume.
- *& DATA f TYPE I OCCURS 3.
- *& INSERT 1 INTO f INDEX 0.
- *& INSERT 2 INTO f INDEX 1.
- *& INSERT 3 INTO f INDEX 2.
- DATA numar_div TYPE I.
- DATA NUMAR_DOI TYPE I.
- DATA NUMAR_TREI TYPE I.
- DATA NUMAR_CINCI TYPE I.
- DATA NUMAR_SAPTE TYPE I.
- numar_div = 25.
- NUMAR_DOI = numar_div MOD 2.
- NUMAR_TREI = numar_div MOD 3.
- NUMAR_CINCI = numar_div MOD 5.
- NUMAR_SAPTE = numar_div MOD 7.
- If NUMAR_DOI = 0.
- WRITE: numar_div , 'este divizibil cu 2'.
- ENDIF.
- If NUMAR_TREI = 0.
- WRITE: numar_div , 'este divizibil cu 3'.
- ENDIF.
- If NUMAR_CINCI = 0.
- WRITE: numar_div , 'este divizibil cu 5'.
- ENDIF.
- If NUMAR_SAPTE = 0.
- WRITE: numar_div , 'este divizibil cu 7'.
- ENDIF.
- DATA numar_text TYPE I.
- numar_text = 10.
- CASE numar_text.
- WHEN 0.
- WRITE: / 'Zero'.
- WHEN 1.
- WRITE: / 'Unu'.
- WHEN 2.
- WRITE: / 'Doi'.
- WHEN 3.
- WRITE: / 'Trei'.
- WHEN 4.
- WRITE: / 'Patru'.
- WHEN 5.
- WRITE: / 'Cinci'.
- WHEN 6.
- WRITE: / 'Sase'.
- WHEN 7.
- WRITE: / 'Sapte'.
- WHEN 8.
- WRITE: / 'Opt'.
- WHEN 9.
- WRITE: / 'Noua'.
- WHEN 10.
- WRITE: / 'Zece'.
- ENDCASE.
- DATA numar_1 TYPE F.
- DATA numar_2 TYPE F.
- DATA operator TYPE C.
- operator = '+'.
- numar_1 = '10.20'.
- numar_2 = '20.30'.
- DATA rezultat TYPE F.
- rezultat = 0.
- CASE operator.
- WHEN '+'.
- rezultat = numar_1 + numar_2.
- WHEN '-'.
- rezultat = numar_1 - numar_2.
- WHEN '*'.
- rezultat = numar_1 * numar_2.
- WHEN '/'.
- rezultat = numar_1 / numar_2.
- WHEN '%'.
- rezultat = numar_1 MOD numar_2.
- ENDCASE.
- WRITE: / 'Rezultatul este: ', rezultat.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement