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
what are decleratives in cobol?
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 ......
What are the different rules to perform a Search?
What is report-item in COBOL?
how do you reference the rrds file formats from cobol programs
which is Best IBM Mainframe Training and Placement Institute in Ameerpet Hyderabad
what is the difference between COBOL2 AND COBOL390?
what is amode(24), amode(31), rmode(24) and rmode(any)?
Explain about different table spaces.
What is comp-1 and comp-2?
How to find out the closest prime number of an input number? I believe it has something to do with SEARCH and COBOL Linear Array.
What is the difference between binary search and sequential search?
How can you get the ksds file records into your cobol program?
Have you used comp and comp-3 in your project? And how?
how can i see junk values in dclgen or in hostvariable of comp ?