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.



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

can anyone explain aboutovrOVRDBF,OPNQRYF, OVRSCOPE and OPNSCOPE?

2 Answers   TCS,


Can we create 300 logical files based on a single physical file using the CRTLF command only once?.

8 Answers  


steps for debugging two rpg programs????

4 Answers  


what is the necessary command needed before OPNQRYF and why?

5 Answers  


Whether a module can consists of many procedures or it can consist of subprocedures having a main procedure?If it is possible that it can contain many individual procedures than can we have different name for complete module and how do we call this module in main modul?

3 Answers   Steria,


You have a *USE authority on a Library and *All authority on a file in that Library.Can you change the data in that file?

1 Answers  


How can we override a file during runtime in RPG? Without using OVRDBF or calling a CL program

1 Answers   UST,


parameters cannot be passed in which one???

4 Answers   CTS,


How can read PF in reverse order (end to start) in CL pgm..

8 Answers   TCS,


3 members in a databasefile .how to read records from all the members?????????

4 Answers   CTS,


What is the significance of UDATE?

5 Answers   IBM,


program to find the number of objects used in a given program through a display.

2 Answers   IBM,


Categories