
- 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
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
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 - Which of the following file opening mode is invalid in COBOL?
Answer : A
Explanation
Valid file opening modes in COBOL are INPUT, OUTPUT, I-O, and EXTEND. APPEND file mode is not available in COBOL.
Q 2 - Where can we specify OCCURS clause?
Answer : C
Explanation
In array declaration, we can specify occurs clause on Elementary item as well as on Group item also.
Q 3 - What does SEARCH ALL do?
Answer : B
Explanation
Search All is a binary search method, which is used to find elements inside the table.
Answer : B
Explanation
88 level number is used for defining condition name entries.
Q 5 - What is the output of following program?
IDENTIFICATION DIVISION. PROGRAM-ID. HELLO. PROCEDURE DIVISION. A-PARA. PERFORM DISPLAY 'A' END-PERFORM. PERFORM C-PARA THRU E-PARA. B-PARA. DISPLAY 'B'. STOP RUN. C-PARA. DISPLAY 'C'. D-PARA. DISPLAY 'D'. E-PARA. DISPLAY 'E'.
Answer : A
Explanation
This is to show how control goes from one Perform statement to other. Go step by step you will understand the flow.
You can try same code using Try it option available below:
IDENTIFICATION DIVISION. PROGRAM-ID. HELLO. PROCEDURE DIVISION. A-PARA. PERFORM DISPLAY 'A' END-PERFORM. PERFORM C-PARA THRU E-PARA. B-PARA. DISPLAY 'B'. STOP RUN. C-PARA. DISPLAY 'C'. D-PARA. DISPLAY 'D'. E-PARA. DISPLAY 'E'.
Q 6 - What is the output of following program?
IDENTIFICATION DIVISION. PROGRAM-ID. HELLO. DATA DIVISION. WORKING-STORAGE SECTION. 01 WS-STRING PIC X(15) VALUE 'ABCDACDADEAAAFF'. PROCEDURE DIVISION. INSPECT WS-STRING REPLACING ALL 'A' BY 'X'. DISPLAY WS-STRING. STOP RUN.
Answer : B
Explanation
Replacing command will replace all the 'A' by 'X'.
You can try same code using Try it option available below:
IDENTIFICATION DIVISION. PROGRAM-ID. HELLO. DATA DIVISION. WORKING-STORAGE SECTION. 01 WS-STRING PIC X(15) VALUE 'ABCDACDADEAAAFF'. PROCEDURE DIVISION. INSPECT WS-STRING REPLACING ALL 'A' BY 'X'. DISPLAY WS-STRING. STOP RUN.
Q 7 - How records are stored & accessed in sequential file organization?
Answer : B
Explanation
A sequential file consists of records that are stored and accessed in sequential order.
Q 8 - Which of the following is not a figurative constant?
Answer : B
Explanation
Comma is not a figurative constant. Figurative constants are constant values.
Q 9 - In which mode you will open the sequential file to append the data in the end.
Answer : D
Explanation
Sequential file is opened in Extend mode to append the data at the end. If you will open the file in Output mode it will delete all the existing data and then write the data.
Answer : D
Explanation
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