- 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 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 - How is sign stored in a COMP-3 field?
Answer : D
Explanation
In COMP-3 field, sign is stored in last nibble.
Answer : D
Explanation
Rewrite verb is used to update the records. File should be opened in I-O mode for rewrite operations. It can be used only after a successful Read operation. Rewrite verb overwrites the last record read.
Q 3 -How you will comment a line in a COBOL program?
A - Code asterisk(*) at 1st column.
B - Code asterisk(*) at 7th column.
Answer : B
Explanation
Coding asterisk (*) at 7th column comments out the complete line in COBOL program.
Answer : A
Explanation
Moving a numeric field to alphanumeric is legal in COBOL.
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 - Set statement is used to change the index value. Set verb is used to initialize, increment or decrement the index value. Is this statement true or false?
Answer : B
Explanation
This statement is true and it is used with Search and Search All to locate elements in table.
Q 7 - If the values of variables in the called program are modified, then their new values will not reflect in the calling program. What type of call is this?
Answer : A
Explanation
The new values will not reflect in the calling program when we use call by content.
Q 8 - In which usage, data item is similar to Long or Double and is represented as double precision floating point number and internally data is stored in hexadecimal format?
Answer : C
Explanation
COMP-2 is represented as double precision floating point number and internally data is stored in hexadecimal format.
Q 9 - Which division provides information of external data sets used in the program?
Answer : D
Explanation
In file control paragraph inside Environment division we mention all the information of external data sets used in the program.
Answer : D
Explanation
It will take 4 bytes, V is Implicit decimal & will not hold any byte.
