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


Please Help Members By Posting Answers For Below Questions

How to know whether the module is dynamical or statistical?

650


How do define dynamic array in cobol. how do you define single dimensional array and multidimensional array in your cobol?

697


i was faced one question- i have value -00001234.56 Suppress the zeroes and the output should be -1234.56 But Not - 1234.56 spaces should not be available after suppressing the zeroes. logic in jcl and cobol?

886


What is the difference between structured cobol programming and object alternativelyiented cobol?

747


Difference between array and sub-script ?

1157






Why would you use find and get rather than to obtain?

677


Is it possible that the redefines clause has different picture clauses compared to the one it redefined?

669


What happens when we move a comp-3 field to an edited (say z (9). Zz-)?

765


Explain how you can characterize tables in cobol?

636


What is the difference between comp and comp-3 usage?

670


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

2655


what is the difference between COBOL2 AND COBOL390?

2444


I have program P1 which calls file F1 which has 100 records and following structure 001 .................. 002 .................. 003 .................. 098 .................... 099 ................... 100 .................... Now I want to read these files and write these records in file F2 in following manner. 001 ...... 051 ..... 002 ...... 052 ..... 003 ...... 053 ..... .......... ....... .......... ....... .......... ....... 048 ........ 098 ...... 049 .......... 099 ....... 050 .... 100 ......

10564


Which is not true about evaluate statement

1565


Write a cobol program making use of the redefine clause.

723