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?

Answers were Sorted based on User's Feedback



Move Zeroes to I move 5 to j perform para1 varying I from 10 by -2 until I = 0 display..

Answer / 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

Move Zeroes to I move 5 to j perform para1 varying I from 10 by -2 until I = 0 display..

Answer / 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

Move Zeroes to I move 5 to j perform para1 varying I from 10 by -2 until I = 0 display..

Answer / shivakumar deshpande

Gayathri is correct ie Answer -3 is correct

Is This Answer Correct ?    4 Yes 0 No

Move Zeroes to I move 5 to j perform para1 varying I from 10 by -2 until I = 0 display..

Answer / suputhru

Gaayathri is right!!!
para1 will be performed only 5 times
J is 5+(5*5) equals 30


correct answer is c) 30

Is This Answer Correct ?    4 Yes 0 No

Move Zeroes to I move 5 to j perform para1 varying I from 10 by -2 until I = 0 display..

Answer / avi

The value of J before the Para call is 5.
Now,the loop executes for 6 times, so 5*6 is added to the
existing value of J.
J=5+(5*6)
=35.
The correct option is 35.

Is This Answer Correct ?    7 Yes 12 No

Post New Answer

More COBOL Interview Questions

What is the difference between a binary search and a sequential search what are the pertinent cobol?

0 Answers  


OCCURS clause is used in the DATA DIVISION on data names at (a) 01 level (b) 77 level (c) 88 level (d) any level from 02 to 49

13 Answers   TCS,


How you can characterize tables in cobol?

0 Answers  


Explain complete concept of table handling in COBOL with an example?

2 Answers   IBM, TCS, Wipro,


I have a occurs for 100 times but it has executed 101 time what could be the reason?

4 Answers  






Give some examples of command terminators?

0 Answers  


Explain about different table spaces.

0 Answers  


given the following: 77 A PIC 9V9 VALUE 9.5 77 B PIC 9 VALUE 9. 77 C PIC V9 VALUE 0.8 77 D PIC 9 77 E PIC 9 77 F PIC 9V999 what are the contenta of D E nad F after the following statements are executed: COMPUTE F ROUNDED=A+C/B MULTIPLY A BY C GIVING E ADD B C A GIVING D ROUNDED a.F=9.589 E=8 D=1 b.F=9.589 E=8 D=9 c.F=9.589 E=7 D=9 d.F=9.589 E=7 D=1

5 Answers   Broadridge, TCS,


if someone is using my file,how can i find which user id is using?

4 Answers  


A cobol program to read a file , match it with other if. If match occurs then write it to an output file. If no match then no need to write it.Error log created by program to track any error.

1 Answers  


How to use the same cobol program in Batch and CICS onlines ? Please expalin with an example. Thanks in advance.

1 Answers  


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

0 Answers  


Categories