Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

what is the necessary keyword needed to scroll subfile records?

1170


How to select highest score of each subject or how to select highest income of every month?

1773


What is the difference between iter and do?

1224


What is the difference between copybooks and subprocedures in as400?

1369


how do you use commitment control in rpg?

1291


which program rpg or cl is efficent to update a transaction onto a database file and why ?

1247


what do you mean by an input subfile, what are the keywords required?

1268


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.

6524


What is a record lock error?

1778


what is an online rpg?

1274


what was the robotech rpg?

1219


How to define data area in RPG program? In which scenario multi occurrence DS is use in AS400?

2023


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.

2646


What is the diff bw PF/LF Name and their Record format name? what is restriction in record format then file name?

3007


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...

1898