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?
Answer Posted / 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 |
Post New Answer View All Answers
What is the Purpose of POINTER Phrase in STRING command in COBOL?
how do you define single dimensional array and multidimensional array in your cobol?
Define static linking and dynamic linking.
For rewrite, why is it mandatory that file needs to be opened?
IF I mention stop run in CICS what happens?
What are the different open modes available in cobol?
What is redefines clause in COBOL?
1.Is it possible to move the data from 99.99 to 99v99? 2.What is the CICS-vsam Compilation process? 3.In My GDG 5 generation will be there GDG3 got an abend what will happen? 4.In my GDG first generation is +1 And I want to add the new generation what will happen previous generation? 5.How can you give the PIC clause below conditions A). s9 (reddy), B). s9 (5) occurs 5 times? 6.How override the proc from a particular step? and what is symbolic and override Procs?
What are the access modes of START statement?
write a cobol logic. i have file that has 10 records .1 record go to first output file and second record goes to 2 output and etc
Write a cobol program making use of the redefine clause.
What are all the divisions of a COBOL program?
what is difference bt COND, REGION & TIME parameters at JOB & EXEC. give an exp.
how to access the file from prodution from changeman tool and to submit a file to production
How arrays can be defined in COBOL?