Write a program to display prime numbers between 1 to 100 using RPGLE.



Write a program to display prime numbers between 1 to 100 using RPGLE...

Answer / saravanan3

D N S 2P 0 INZ 0
D Q S 2P 0
D R S 2P 0
D I S 2P 0

C PARM N
MOVE 2 I
DOU I >= N
I DIV N Q
MVR R
IF R=0
“Number is not PRIME” DSPLY
ENDIF
ADD 1 I
ENDDO
IF N=I
THEN
“Number is PRIME” DSPLY
ENDIF
C SETON LR

Is This Answer Correct ?    3 Yes 2 No

Post New Answer

More RPG400 Interview Questions

How to set on/off a group of indicators in a single statement?

3 Answers  


Mr.Sidc sirfor my question{how to convert date format from one format to another i think in CL/400 its CVTDAT,Please tell in RPG/400 sir not in RPGILE} you have answered using MOVE opcode,can you illustrate me with a small example sir very kind of you.

1 Answers   CTS, IBM, iGate,


how can you display specific subfile page on the screen in unequal subfile?

0 Answers   IBM,


Hi, Can any body tell me ur experience on this questions? Questions: 1.what is the use of SFLRCDNBR other than subfile page display? 2.Which of the following operation cannot be used in conjuction with a file coded as device type disk?

1 Answers  


Program to read marks of 10 students for 4 subjects and compute and display total marks and status of each student in rpg

0 Answers  






What is use of IMPORT and EXPORT in RPGLE ? What is activation Group ? What is Service Program ???? How to call another program in RPGLE ?

1 Answers  


Assume 2 users are using the same file and first user updates some record in the file. Will the 2nd user will be able to see the updated record or not?

0 Answers  


1.String operatio such as moving the characters to the variables? 2.what are the building functions for check file longs? 3.which of the following methods will make externally describe file fields available to a program? A: A/copy statement that specifies the library file and member of the field reference file source code B: A data structure definition specification that names the file on the EXTNAME keyword C: A data structure definition specification that names the file on the IMPORT keyword? D: A Definition specification for each desired field with the REFFLD keyword

1 Answers   CSC, CTS,


How to declare the pull button in AS/400..

0 Answers  


How do I link an existing logical file to it's Physical File without recompiling?

2 Answers  


Can we journel logical file and access path? Can we use commitment control for non-join L.F?

4 Answers  


can I touch the array during treatments?

0 Answers   IBM,


Categories