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
How can we override a file during runtime in rpg?
What are the types of identifiers?
If my rpg program has a date field, what extra care I have to take while compiling that rpg program? If the file is keyed and I have declared the file as well as key list properly in my program. Still am getting an error message like "chain/reade operation is not allowed" what may be the case?
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...
how does the rpg element work?
How to declare the pull button in AS/400..
When it is desirable to describe files Internally?
How to define data area in RPG program? In which scenario multi occurrence DS is use in AS400?
What is the diff bw PF/LF Name and their Record format name? what is restriction in record format then file name?
can I touch the array during treatments?
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.
can any one help in hawkeye and turnover or any change management system plzzzzz or send the documents to my mail id :gvsp.as4@gmail.com
how do I preserve and clean the array?
how do I declare a minor?
How do u design a physical file, when you have 2 Unique fields like for eg in A student file student ID and student examination no both are unique