If A>B
next sentence
end-if
display 1
display 2.
display 3.
If a>b, it will display only 3.(the next sentence,
ie., after fullstop/period)
____________________________________
if a>b
continue
end-if
display 1
display 2.
display 3.
If a>b, it Will display 1 2 3 (the next statement)
____________________________________
if a>b
continue
display 1
end-if
display 2
display 3.
display 4.
If a>b, Will it display 2 3 4 (or) 1 2 3 4 ?
Answers were Sorted based on User's Feedback
Answer / muttaiah
Really, Did someone execute this code before posting your
answers..
If a novice goes through this chat he will get confused
like which answer is correct
The asnwer is 2 3 4 why because whenever control encounters
continue it will start executing the stmt only after scope
terminator which is end-if in this case.
so 2 3 4 is the answer i have executed the code also.
| Is This Answer Correct ? | 3 Yes | 0 No |
Answer / sakthi kumar
Actually Continue is a do nothing statement, so it will
proceed as it is.
It will display 1 2 3 4
| Is This Answer Correct ? | 4 Yes | 2 No |
Answer / supriya tenany
Displaying '1', depends actually on the 'if' condition, since it is in the 'if' loop.
| Is This Answer Correct ? | 1 Yes | 0 No |
Answer / santy
for the first condition:-
If A>B
next sentence
end-if
display 1
display 2.
display 3.
If a>b, it will display only 3.(the next sentence,
ie., after fullstop/period)- is the Correct Answer.
for the second condition:-
if a>b
continue
end-if
display 1
display 2.
display 3.
If a>b, it Will display 1 2 3 (the next statement)
This is also correct answer, b'cos continue is doing
nothing other than passing control to next statement.
for the third condition:-
if a>b
continue
display 1
end-if
display 2
display 3.
display 4.
If a>b, Will it display 2 3 4 (or) 1 2 3 4 ?
Correct answer is the 1 2 3 4.
b'cos here continue will excuite next statement and after
the 'display3.' is excuitute then control pass to 'display
4.' sentence.
hopes now you r clear ur idea.
| Is This Answer Correct ? | 3 Yes | 2 No |
What is the mode in which you will OPEN a file for writing?
Where the Plan is located in CICS-DB2
How you can characterize tables in cobol?
how we sort two input files based on a common column and giving one o/p file please send me the coding logic?
01 A pic 9(100) find record length of it
) What is the use of IGNORE?
What the difference is between continue and next sentence?
What is the different between index and subscript?
soc-7 is a bad data,invalid data. when ever we are moving the alphabets in the position of numeric then we got this abend. so my question is if o1 ws-data pic 9(1) value passing the alphabet some x. then we got soc-7 or not? i want clarification ?
how to run sub programs using static and dynamic call ...
if a pic 9(3) value 354,b pic x(2) value '46' then a)a>b 2)a<b 3)error
01 a pic s9(5) occupies how many bytes ?