Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

remainder of division

Former Member
0 Kudos

How to write that the remainder of 5 divided by 2 is 1

1 ACCEPTED SOLUTION

Former Member

use d = 5 mod 2 now d will hold the value 1

data : d type i.

d = 5 mod 2.

write: d.

Edited by: Ashish Paliwal on Sep 24, 2008 4:14 PM

9 REPLIES 9

Former Member

use d = 5 mod 2 now d will hold the value 1

data : d type i.

d = 5 mod 2.

write: d.

Edited by: Ashish Paliwal on Sep 24, 2008 4:14 PM

Former Member
0 Kudos

Use function MOD.

Data: nmod type i.

nmod = n1 MOD n2.

n1 and n2 are numbers.

kiran_k8
Active Contributor
0 Kudos

Anjali

Use the MOD keyword.

ie REM = ITAB-LFIMG MOD L_SCMNG.

K.Kiran.

Former Member
0 Kudos

Hi,

Try this.

Make use of 'MOD' operator.

rem = 5 mod 2.

you will get the remainder in the variable rem.

Sharin.

former_member585060
Active Contributor
0 Kudos

Try this code

DATA : i TYPE i VALUE 5,

j TYPE i VALUE 2,

k TYPE i.

j = 5 MOD 2.

write 😕 J.

rainer_hbenthal
Active Contributor
0 Kudos

write:/ 'the remainder of 5 divided by 2 is 1'.

0 Kudos

Rainer Hübenthal

write:/ 'the remainder of 5 divided by 2 is 1'.

Good one.

cheers : - )

0 Kudos

i did that but its not working, thats y was asking

0 Kudos

Its working for me try as follows,

DATA : x TYPE n,
y TYPE n,
z TYPE n,
msg(50) TYPE c.
y = 5.
z = 2.
x = y MOD z.
CONCATENATE 'Remainder of' y 'Divided by' z 'is' x into msg SEPARATED BY space.
WRITE msg.

Regards

Karthik D