Follow Our FB Page << CircleMedia.in >> for Daily Laughter. We Post Funny, Viral, Comedy Videos, Memes, Vines...

Hi.can any body give me the code for this quesiton
please.Because i dont have to try to enter the code in to
the AS/400 server.Please can anybody give the answer for
this question with complete code?
A smple RPLE pgm which accepts the starting number and
ending number as parameter.It then has to count all the odd
numbers b/w the accepted range of numbers and display the
results/

Ex:if the input parameters are 11 and 30 the result should
be 10(11,13,15,17,19,21,23,25,27,29)

Please explain and give me the complete code?

Answer Posted / arun kumar

D Start S 3S 0
D End S 3S 0
D Count S 3 0
D Temp S 3 0
D Rslt S 3 0
D Rslt1 S 3 0
C *Entry PLIST
C PARM Start
C PARM End
/Free
Eval Temp = Start;
Eval Count = Start;
DoW Count <= End;
If %Rem(Temp:2) <> 0;
Rslt1 = Rslt1 + 1; //Number of ODD Numbers
Rslt = Rslt + Temp; //Sum of ODD Numbers
EndIf;
Temp = Temp + 1;
Count += 1;

EndDo;
Dsply Rslt1;
Dsply Rslt;
*InLR = *ON;
/End-Free
C** *InzSR BegSR
C** EndSR

Is This Answer Correct ?    0 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

define what a data queue is along with a brief example of what it may be used for?

336


how many printer files maximum can be used in single rpg program?

235


what is the sequence when using cursor?

217


The content of Physical file is as below: hfcftp wruquief SENDPASV 0 CDUP ASCII GET 01100901.CSV ramndk/ECP505.EC0110090 (REPLACE QUIT Thw above commands will get executed when we call STRTCPFTP from CL program.... Now if I want to use SFTP what can be the solution? plz reply in detail....Thank you for ny help... I m using RPG/ILERPG to download...

1483


when do you use f-spec. Continuation line ?

331






when is a tag statement used in rpg?

406


how can I automatically refresh a web page?

237


when do you explicitly open files and close files in an rpg program?

366


all i need to know about cmpseqdat parameter in cmppfm, how it works and can we retrieve line sequence and date from the output?

1939


What is data structure in as400? What is the use of data structure?

218


how can you specify no duplicate key?

228


when would you prefer logical file than opnqryf?

344


what does the opcode free do?

324


what is service program?

236


which of the following operations does not zero the field flda defined as 4,0?

233