Write a program to display prime numbers between 1 to 100 using RPGLE.
Answer Posted / 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 View All Answers
what is the necessary keyword needed to scroll subfile records?
How to select highest score of each subject or how to select highest income of every month?
What is the difference between iter and do?
What is the difference between copybooks and subprocedures in as400?
how do you use commitment control in rpg?
which program rpg or cl is efficent to update a transaction onto a database file and why ?
what do you mean by an input subfile, what are the keywords required?
1. What is bound-by-call and bound-by-reference? 2. Where and why is *Nomain used? 3. What are the difficulties faced by programmers when using service programs? 4. Explain the different ways of parsing and compiling XML in iSeries.
What is a record lock error?
what is an online rpg?
what was the robotech rpg?
How to define data area in RPG program? In which scenario multi occurrence DS is use in AS400?
if there is a module object , how to find the program object for this module object.Assume the module object name and program object name is not same.
What is the diff bw PF/LF Name and their Record format name? what is restriction in record format then file name?
How to create a login screen using a command instead of display file.... intention is to get a password field on a command..... how do you achieve this...