write the program for prime numbers between 1 to 1000

Answer Posted / kallol banerjee

data: n type i default 1,
m type i,
p type i,
r type p decimal 2,
l_v_cnt type n.

do n times.
if n <= 1000.
m = 1.
do m times.
if m <= n.
r = n / m.
p = n / m.
m = m + 1.
if r = p.
l_v_cnt = l_v_cnt + 1.
endif.
endif.
enddo.
else.
exit.
endif.
if l_v_cnt = '2'.
write: n.
endif.
n = n + 1.
enddo.

Is This Answer Correct ?    19 Yes 11 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is going life actually? What is the role of a functional consultant in it? : sap abap hr

546


What are authorization objects and what statement is used to perform an authorization check in an abap program?

561


What is the max no of match code id’s that can be defined for one match code object?

675


What are the names of the function modules that will be generated upon activation of a lock object?

543


What are the two methods for modifying sap standard tables?

726






what is the process of creating quotation using BAPIs.

1567


hi I am in training of functional module, i am unable to understand what exactly use of IDOC,BAPI,DIM and BIM. As LSMW and BDC methods are used for data conversion from legacy to sap. Might be it is silly question. please explain me

1767


Define subtype ? : abap hr

607


Is there any BAPI to retrieve list of customers and their sales areas i.e., Cust No, Distr Channel and Division for all the customers.

1574


Sy index and sy tabix

959


What is sapnet?

877


Explain the advantages and disadvantages of abap query tool?

514


What are the components of sap scripts? : abap hr

580


Explain get pernr concept when we use logical data base? : abap hr

744


What is buffering allowed but switched off?

857