PERFORM ACCUMULATE-TOTALS
VARYING A FROM 1 BY 2 UNTIL A >2
AFTER B FROM1 BY 1 UNTIL B>2
AFTER C FROM 2 BY -1 UNTIL C<2
How many times the paragraph ACCUMULATE-TOTALS would be
exicuted?
Answers were Sorted based on User's Feedback
Answer / shakilaashwin
PERFORM ACCUMULATE-TOTALS
VARYING A FROM 1 BY 2 UNTIL A >2
AFTER B FROM 1 BY 1 UNTIL B>2
AFTER C FROM 2 BY -1 UNTIL C<2.
ACCUMULATE-TOTALS.
ADD 1 TO ACCUMULATE-CNT.
DISPLAY 'A - ' , A.
DISPLAY 'B - ' , B.
DISPLAY 'C - ' , C.
Ans is 2 - The loop will be executed until all the condition
(A > 2, B > 2, C < 2) becomes True.
Execution : 1 Condition is
A - 1 True
B - 1 True
C - 2 False
Execution : 2
A - 1 False
B - 2 True
C - 2 False
When going for 3rd execution - No condition Will be True
Is This Answer Correct ? | 6 Yes | 2 No |
Answer / shan
looping happens for following values of
A, B, C
1, 1, 2 = 1st
1, 2, 2 = 2nd
2, 1, 2 = 3rd
2, 2, 2 = 4th
So totally four times this will get executed
Is This Answer Correct ? | 2 Yes | 3 No |
Sending data is aplhabetic size 7 (value 3000), I wantated this value to be stored in database, which is defined as s9(7)v9(2)comp-3.
which is better comp or comp-3 in terms of memory utilization?
which one is better among static call and dynamic call?
) How do you access the migrate the data from production region to development region
When can the USING phrase be included in the call statement ?
what are the diferences b/w sub-script and index?
Differentiate between structured cobol programming and object-oriented cobol programming.
How to covert given string into ASCII value in COBOL/MF COBOL
What is the difference between CONTINUE & NEXT SENTENCE ?
What is the Purpose of Pointer in the string?
What care has to be taken to force program to execute above 16 Meg line?
study the following 01 A PIC 99V0 VALUE 5 01 B PIC 9V9 VALUE 6 01 C PIC 99V9 VALUE 2.5 01 D PIC 99 VALUE 3 COMPUTE A ROUNDED B C = A+B*C/D ON SIZE ERROR PERFORM PRINT-ERROR the comments of A.B.C after execution of the above statement are a.A=10 B=0 C=10 b.A=10 B=9.9 C=9.9 c.A=10 B=0 C=9.9 d.A=10 B=6 C=10