Free COBOL Multiple Choice Questions:Part 1

IBM Mainframe COBOL MCQ.

The MCQ Answers are in Bold Letters.

1) The following portion of procedure division
MOVE 0 TO A, I.
PARA-1.
ADD 3 TO A.
ADD 2 TO I.
IF I < a=" ‘,">B MOVE A TO C
ELSE MOVE B TO C.
ADD C TO D.
Indicate which one of the following does not support the above statements1. The value of A will be added to D only if A is greater than B.
2. The value of B will be added to D only if B is greater than A.
3. The larger of the values, A and B will be added to D.

2) IF NOT AGE LESS THAN 30 AND 40
GO TO PARA-AGE-MIDDLES. The controls will go to the paragraph named PARA-AGE-MIDDLE.
(a) if AGE is greater than or equal to 40.
(b) If AGE is greater than or equal to 30.
(c) If AGE is greater than or equal to 30 but less than 40.
(d) If AGE is less than or equal to 30.

3) Indicate which of the following is true about the 88 level entry.(a) it is used for individual data item in working-storage section.
(b) It is used for items with rename clause.
(c) It is used for a data item which redefines another data item.
(d) It is used for a condition name which can have either a true or false.

4) IF A = 1 OR 2 OR 3 NEXT SENTENCE
ELSE MOVE A TO B.
Which of the following describes the above sentence correctly.
(1) IF A NOT = 1 OR 2 OR 3 MOVE A TO B.
(2) IF NOT A = 1 AND 2 AND 3 MOVE A TO B.
(3) IF A NOT = 1 AND 2 AND 3 MOVE A TO B.(4) IF A NOT = 1 OR A NOT = 2 OR A NOT = 3 MOVE A TO B.

5) IF A <> D GO TO P1
ELSE IF NOT (A > B OR B < a="6," b="7," c="5" d="8">

(1) P1
(2) P2(3) P3
(4) NONE OF THE ABOVE.

6) Determine the total number of bytes in the following.01 REC-1.
02 FIRST-GROUP.
03 A1 PIC X(4).
03 A2 PIC 99.
02 REDEFINES FIRST-GROUP.
03 A3 PIC 999.
03 A4 PIC 999.
02 THIRD-GROUP.
03 A5 OCCURS 5 TIMES PIC 99.
(1) 22
(2) 16
(3) 12
(4) 14

7) Determine the bytes
01 REC-1.
01 A PIC X(6).
02 B REDEFINES A.
03 C OCCURS 6 TIMES PIC 9.
02 D OCCURS 4 TIMES.
03 E PIC X(5).
03 F PIC 999.
1) 38
2) 44
3) 14
4) 12

8) Which of the following statements are incorrect.(1) Subscripting enables us to write a more compact code in the procedure division.
(2) Subscripting enables us to refer to any element of a table by the same data name with the facility of identifying the particular element through the values of subscript.
(3) Subscripting reduces the number of entries to be included in the data division.
(4) Subscripting enables us to use loops in the procedure division.
Related Posts

No comments:

 

Aired | Copyright © 2009-2014| All Rights Reserved 2014

Contact Us | About Us