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



If A>B next sentence end-if display 1 display 2. display 3. If a>b, it will displ..

Answer / dharma

it will display 2 3 4 only

Is This Answer Correct ?    4 Yes 1 No

If A>B next sentence end-if display 1 display 2. display 3. If a>b, it will displ..

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

If A>B next sentence end-if display 1 display 2. display 3. If a>b, it will displ..

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

If A>B next sentence end-if display 1 display 2. display 3. If a>b, it will displ..

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

If A>B next sentence end-if display 1 display 2. display 3. If a>b, it will displ..

Answer / rajeumesh

Answer # 3 is correct

Is This Answer Correct ?    1 Yes 0 No

If A>B next sentence end-if display 1 display 2. display 3. If a>b, it will displ..

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

If A>B next sentence end-if display 1 display 2. display 3. If a>b, it will displ..

Answer / suputhru

Correct answer is the 1 2 3 4.

Is This Answer Correct ?    1 Yes 0 No

If A>B next sentence end-if display 1 display 2. display 3. If a>b, it will displ..

Answer / kamal

if a>b
continue
display 1
end-if
display 2
display 3.
display 4.
it will disply 1,2,3,4.

Is This Answer Correct ?    2 Yes 2 No

Post New Answer

More COBOL Interview Questions

Hai friends why we need to read a file before re-write a record?

7 Answers   L&T,


what is the size of W-REC in the following 01 W-REC 05 A PIC 9(4)V99 05 B READLINES A 10 C PIC XX 10 D PIC S9(4) 05 E OCCURS 7 PIC ZZ.ZZ 05 F OCCURS 5 10 G PIC ZZ.ZZZ99 10 H OCCURS 3 15 J PIC 9(3) 15 K PIC V99

2 Answers   TCS,


how to create temporary data set in jcl? what is the use?

3 Answers   Cap Gemini, Temenos,


I have two files , file1 is input file it contains 10,20,30,....,records but i want to display the records in file 2 as reverse order .how can we do by using jcl& cobol(dont use array) please any one can tell me the answer

3 Answers   GreenTree, IBM,


how to transfer the file from pc to mainframe??

3 Answers  






Please let me know at which Scenarios we will go for STATIC call or DYNAMIC

3 Answers   IBM,


how to convert vsam table into DB2 table?

1 Answers   IBM, Wipro,


In a COBOL program, 2 tables TABLE1 and TABLE2 are defined that are indexed by INDEX1 and INDEX2 respectively. Can we use INDEX1 with TABLE2 and INDEX2 with TABLE1?

1 Answers  


What is an in-line perform ?

4 Answers   Accenture,


What are the cobol coding sheets?

0 Answers  


What is the difference between write & move in COBOL?

3 Answers   CSC, HHB,


what is redefines? where it can be effectively use for the purpose of memory utilization? give an example?

4 Answers   IBM,


Categories