- COBOL Tutorial
- COBOL - Home
- COBOL - Overview
- COBOL - Environment Setup
- COBOL - Program Structure
- COBOL - Basic Syntax
- COBOL - Data Types
- COBOL - Basic Verbs
- COBOL - Data Layout
- COBOL - Conditional Statements
- COBOL - Loop Statements
- COBOL - String Handling
- COBOL - Table Processing
- COBOL - File Handling
- COBOL - File Organization
- COBOL - File Access Mode
- COBOL - File Handling Verbs
- COBOL - Subroutines
- COBOL - Internal Sort
- COBOL - Database Interface
- COBOL Useful Resources
- COBOL - Questions and Answers
- COBOL - Quick Guide
- COBOL - Useful Resources
COBOL Online Quiz
Following quiz provides Multiple Choice Questions (MCQs) related to COBOL Framework. You will have to read all the given answers and click over the correct answer. If you are not sure about the answer then you can check the answer using Show Answer button. You can use Next Quiz button to check new set of questions in the quiz.
Q 1 - What is the maximum size of a numeric field we can define in COBOL?
Answer : B
Explanation
COBOL applications use 31 digit numeric fields. However, compiler only supports a maximum of 18 digits. So we use a maximum of 18 digits.
Q 2 - Which utility is used for compiling COBOL program?
Answer : B
Explanation
IGCRCTL utility is used to compile a COBOL program.
Q 3 - Which of the alphanumeric literal is invalid?
Answer : D
Explanation
'COBOL12" is invalid because inverted commas should be in pair and should be of same type.
Q 4 - What is the output of following program?
IDENTIFICATION DIVISION. PROGRAM-ID. HELLO. DATA DIVISION. WORKING-STORAGE SECTION. 01 WS-ID PIC 9(5). PROCEDURE DIVISION. A000-FIRST-PARA. INITIALIZE WS-ID REPLACING NUMERIC DATA BY 12345. DISPLAY WS-ID. STOP RUN.
Answer : B
Explanation
WS-ID will be initialized and numeric data will be replaced by 12345 as mentioned in the statement.
You can try same code using Try it option available below:
IDENTIFICATION DIVISION. PROGRAM-ID. HELLO. DATA DIVISION. WORKING-STORAGE SECTION. 01 WS-ID PIC 9(5). PROCEDURE DIVISION. A000-FIRST-PARA. INITIALIZE WS-ID REPLACING NUMERIC DATA BY 12345. DISPLAY WS-ID. STOP RUN.
Answer : B
Explanation
S9(6) USAGE is COMP will take 4 bytes based on the following formula which is used to calculate when USAGE is COMP :
S9(n) USAGE is COMP
If 'n' = 1 to 4, it takes 2 bytes.
If 'n' = 5 to 9, it takes 4 bytes.
If 'n' = 10 to 18, it takes 8 bytes.
Q 6 - What is the output of following program?
IDENTIFICATION DIVISION. PROGRAM-ID. HELLO. DATA DIVISION. WORKING-STORAGE SECTION. 01 WS-TABLE. 05 WS-A PIC A VALUE 'A' OCCURS 5 TIMES. PROCEDURE DIVISION. DISPLAY WS-TABLE. STOP RUN.
Answer : B
Explanation
We are displaying the complete table so all the 5 occurrences will come 'AAAAA'.
You can try same code using Try it option available below:
IDENTIFICATION DIVISION. PROGRAM-ID. HELLO. DATA DIVISION. WORKING-STORAGE SECTION. 01 WS-TABLE. 05 WS-A PIC A VALUE 'A' OCCURS 5 TIMES. PROCEDURE DIVISION. DISPLAY WS-TABLE. STOP RUN.
Q 7 - How records are stored & accessed in indexed file organization?
Answer : D
Explanation
An indexed sequential file consists of records that can be accessed sequentially. Direct access is also possible.
Q 8 - Dynamic Call occurs when a program is compiled with the DYNAM and NODLL compiler option. A dynamic called program is loaded into storage at runtime. Is this statement true or false?
Answer : B
Explanation
This statement is correct.
Q 9 - In which division we write logic of the program?
Answer : A
Explanation
Procedure division is used to include the logic of the program. It consists of executable statements using variables defined in the data division. In this division, paragraph and section names are user-defined.
Answer : D
Explanation
It will take 4 bytes, V is Implicit decimal & will not hold any byte.
To Continue Learning Please Login
Login with Google