Consider the following:
77 W-NUM PIC 9 VALUE 0
------
MOVE 1 TO W-NUM
PERFORM PARA-X UNTIL W-NUM > 9.
------
PARA-X
ADD 1 TO W-NUM
How many times PARA-X is executed ?
Answers were Sorted based on User's Feedback
Answer / guna
9 times.
Initially, W-Num value will be 1.
1>9, so para will be executed. - 1 time
2>9, so para will be executed. - 2 times
3>9, so para will be executed. - 3 times
4>9, so para will be executed. - 4 times
5>9, so para will be executed. - 5 times
6>9, so para will be executed. - 6 times
7>9, so para will be executed. - 7 times
8>9, so para will be executed. - 8 times
9>9, so para will be executed. - 9 times
10>9, so para will not be executed
so para is executed for 9 times.
| Is This Answer Correct ? | 7 Yes | 9 No |
Answer / satish29
Infinite loop because w-num value does not change.
| Is This Answer Correct ? | 2 Yes | 5 No |
What is the maximum size of a 01 level item in COBOL I? in COBOL II?
When is a scope terminator mandatory?
How to find out the closest prime number of an input number? I believe it has something to do with SEARCH and COBOL Linear Array.
How can we know that cobol program is using report file or simple file....?
i want to learn mainframes. i completed MCA ,whats the future of mainframes
what is the maximum error code in mainframe
How can you add a particular field in copybook?
How can you add a particular field/coloumn in copybook?
input:- 12233344445555566666... output:- 1=1,2=4,3=9... Here firstno i.e 1 should be displayed and after that the alikeno.s should be added n displayed.i.e 2+2=4 like tat it goeson.
What does the IS NUMERIC clause establish ?
In COBOL programming, what is PERFORM? What is VARYING?
How can you pass values from COBOL program to non-COBOL programs?