Hi Girish

Please see the below code .It prints the prime numbers

from 1 to 100.

We can change the code if we want to get the number

range from selection screen.

DATA : number TYPE i,

result TYPE p DECIMALS 2,

temp TYPE i VALUE 0,

fraction_part TYPE p DECIMALS 2,

no_of_zero TYPE i.

number = 1.

DO 100 TIMES.

DO number TIMES.

temp = temp + 1.

result = number / temp.

fraction_part = frac( result ).

IF fraction_part EQ 0.

no_of_zero = no_of_zero + 1.

ENDIF.

ENDDO.

IF no_of_zero LE 2.

WRITE : / 'NUMBER' , number ,'IS PRIME'.

ENDIF.

CLEAR : no_of_zero, temp.

number = number + 1.

ENDDO.

if anyone has got any suggestion to improve the code

please letme know.

Regards,

Sumit Khetawat

--- satyagirish satya <

satyagirish_v@...>

wrote:

> hello friends

>

> here are the qustions which were ask at IBM(

> wriiten exam)

>

> 1) print prime number

> 2) palindrome of string,

> 3) validation of selection-screen

> 4) print the customer detalis where custo no is

> between 51 and 57

> 5) i dont remember

>

> total time for 5 questions is 1 hrs

> send the answers accross

>

> regards

> Velchal girish.

>

>

>

> ---------------------------------

> Jiyo cricket on Yahoo! India cricket

> Yahoo! Messenger Mobile Stay in touch with your

> buddies all the time.

__________________________________________________

Do You Yahoo!?

Tired of spam? Yahoo! Mail has the best spam protection around

http://mail.yahoo.com