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 / gayathri
The para1 will be performed only 5 times for the values of
I = 10, 8, 6, 4, and 2 respectively. Para1 can not be
executed for the value I = 0 as it uses Perform until
condition.
so the value of J is 5+(5*5) equals 30
correct answer is c) 30
Please correct me if I am wrong.
| Is This Answer Correct ? | 13 Yes | 1 No |
Post New Answer View All Answers
How to use the same COBOL program in Batch and CICS on lines? explain with an example
Write some characteristics of cobol as means of business language.
What is the difference between binary search and sequential search?
Whats the difference between search & search ALL?
how do you reference the ksds vsam file formats from cobol programs
Have you used comp and comp-3 in your project? And how?
In COBOL, what is the different between index and subscript?
How do define dynamic array in cobol. how do you define single dimensional array and multidimensional array in your cobol?
How to read the 2nd last record of a VSAM file? (The file size is huge and we don't know the key)
What is the difference between a binary search and a sequential search what are the pertinent 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 ......
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?
how do you reference the printer file formats from cobol programs
What is the difference between comp and comp-3?
What are the various section in data division and briefly explain them.