09-21-2007 4:50 AM
1
1 2 3
1 2 3 5
1 2 3 5 7
1 2 3 5 7 11
1 2 3 5 7 11 13
1 2
please very urgent
09-21-2007 5:04 AM
HAI,
see the program below apply the logic to ur program.
data : int1 type i value 1,
int2 type i value 1,
int3 type i,
int4 type i,
count type i value 1.
parameter : value type i.
int3 = value.
while ( int1 < int3 ).
while ( int2 <= int1 ).
write : INT2..
int2 = int2 + 1.
endwhile.
write :/.
int1 = int1 + 1 .
int2 = 1.
endwhile.
09-21-2007 5:04 AM
HAI,
see the program below apply the logic to ur program.
data : int1 type i value 1,
int2 type i value 1,
int3 type i,
int4 type i,
count type i value 1.
parameter : value type i.
int3 = value.
while ( int1 < int3 ).
while ( int2 <= int1 ).
write : INT2..
int2 = int2 + 1.
endwhile.
write :/.
int1 = int1 + 1 .
int2 = 1.
endwhile.
09-21-2007 5:11 AM
HI VIKRAM,MANY THANKS BUT I WANT ODD NUMBERS AFTER 2 'S DISPLAY. I GOT THE OUTPUT AS U GAVE ME BUT I AM NOT GETTING THE ODD ONES.CANU TRY PLSSSS
09-21-2007 5:43 AM
try this
PARAMETERS : P_NO TYPE I DEFAULT 5.
DATA : VAL TYPE I,
DIV TYPE I,
REM TYPE I,
EVEN.
DATA : BEGIN OF IODD OCCURS 0,
VAL TYPE I,
END OF IODD.
DO P_NO TIMES.
REM = 1.
VAL = VAL + 1.
DO VAL TIMES.
DIV = DIV + 1.
IF DIV LT VAL AND DIV GT 1.
REM = VAL MOD DIV.
ENDIF.
IF REM EQ 0.
EVEN = 'X'.
ENDIF.
ENDDO.
IF EVEN IS INITIAL.
IODD-VAL = VAL.
APPEND IODD.
ENDIF.
CLEAR : DIV,EVEN.
ENDDO.
CLEAR : VAL,DIV,REM.
SORT IODD BY VAL.
DESCRIBE TABLE IODD LINES DIV.
DO DIV TIMES.
VAL = VAL + 1.
LOOP AT IODD.
REM = REM + 1.
IF REM LE VAL.
WRITE : IODD-VAL.
ENDIF.
ENDLOOP.
WRITE : / .
CLEAR : REM.
ENDDO.
regards
shiba dutta
09-21-2007 11:36 AM
hi shiba dutta,
thanks a lot for ur support.its working.pls continue ur support.
-
kartikeya bommuluri
09-21-2007 11:41 AM
09-21-2007 12:14 PM
I forgot to say wel come to SDN . In this forum Better way to say thanks by assigning points to the helpful answers. You can assign the points by clicking the star ( * ) marks left of each answer. 2 for yellow, 6 for green and 10 for black.
Please assign the marks to all the helpful answers accordingly.
regards
shiba dutta