Move Zeroes to I
move 5 to j
perform para1 varying I from 10 by -2 until I = 0
display j.
para1.
Add 5 to j.
What’ll be the value after execution of display stmt.
A) 35
B) 40
C) 30
D) 25
please explain how?
Answer Posted / sudeshna majumdar
Correct answer is c) 30.
The para1 will be performed 6 times where the values of I
will be 10, 8, 6, 4, 2, and 0 respectively.
After each processing of para1, value of J will be
incremented by 5 and value of I will be decremented by 2.
Now, the para1 is called starting from I = 10 and ends when
I = 0. Thus, after 6 time para1 processing,J value will be
5*6 = 30.
| Is This Answer Correct ? | 10 Yes | 4 No |
Post New Answer View All Answers
how do you define single dimensional array and multidimensional array in your cobol?
How to get the last record in vsam file in cluster? And how can you get the ksds file records into cobol program?
Why occurs cannot be used in 01 level in COBOL?
I need to compare 3 variables(dates) and do some processing based on the earliest date. There could be more then 1 date record in any of the 3 fields. What is the best way to code this?
Which Search verb is equivalent to PERFORM…VARYING?
Name some of the examples of COBOl 11?
What are various search techniques in cobol? Explain.
What are all the divisions of a COBOL program?
i need a small 3d program using inline and outline.
How do you get the data to code the BMS macro?
What do you understand by psb and acb?
If you are current on the owner of a set, what is the difference between an obtain next and obtain first? Actually in which topic will we use dis???Plz explain it clearly
How to know whether the module is dynamical or statistical?
What are 77 levels used for?
What are the different open modes available in cobol?