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

How can we override a file during runtime in rpg?

1171


What are the types of identifiers?

989


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?

1071


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

1841


how does the rpg element work?

1171


How to declare the pull button in AS/400..

2314


When it is desirable to describe files Internally?

1674


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

1976


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

2958


can I touch the array during treatments?

1130


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.

6429


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

2373


how do I preserve and clean the array?

1105


how do I declare a minor?

1129


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

982