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
Name some of the examples of COBOl 11?
What is the difference between perform … with test after and perform … with test before?
1.give the details about WHEN OTHER. 2. how many form are available in evaluate.
Write down the divisions of cobol program?
How do you define a variable of comp-1 and comp-2?
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?
Can a Search can be done on a table with or without Index?
if we display var1 then what will b displayed in below condition. 77 var1 pic s9(2) value -10. 77 var1 pic s9(2) value -11. " " " -12. " " " -13. -14 ... ... -19.
What is the difference between goback, stop run and exit program in cobol?
Name the sections present in data division.
What are the pertinent COBOL commands?
How to remove the spaces at the end of each record in the output file of variable length, via cobol program?
how do you reference the printer file formats from cobol programs
How to traceback if I am getting SOC7 or SOC4 abend? List down the steps
EXPLAIN MAIN FRAME TESTING PROCESS...HOW TO FIX THE MAINFRAME BUGS?