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

Hi, I am getting the error in RPG (All Record Formats for externally-described file ABCD ignored or dropped due to error; file ignored.) Please suggest any

2 Answers   Satyam,


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

8 Answers   TCS,


what is the use of sflnxtchg?

0 Answers   IBM,


what is the procedure and explain about real time scenario.

0 Answers   Adhoc Technologies, Hanuman Automation, HSBC, IBM,


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

0 Answers  


steps for debugging two rpg programs????

4 Answers  


Can we used ovrdbf command after the opnqry file if yes then What will be out put of your program?

4 Answers   IBM,


what r drawbacks of OPM? Why do we go for ILE RPG?

1 Answers  


Can anybody tell me the setps to create .csv file in IFS folder on AS/400. I also need to know how I can send this .csv file to PC in xls sheet.....?

2 Answers  


in rpg could u please tell me errors types and meanings like 3030 that ....

1 Answers   EXL, UHG,


How can we override a file during runtime in rpg?

0 Answers  


what built in function can be used with SETLL.If you want to check whether the search argument is successful or not? Please give me answer with example?

3 Answers  


Categories