- 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 mode in which you will OPEN a file for writing?
Answer : C
Explanation
To write into a file, the file has to be opened in either OUTPUT or EXTEND mode.
Q 2 - Which utility is used for compiling COBOL program?
Answer : B
Explanation
IGCRCTL utility is used to compile a COBOL program.
Answer : B
Explanation
10.9- is invalid because sign can not be mentioned on the right.
Answer : B
Explanation
Moving a numeric field to alphabetic field is illegal in COBOL. It will throw error.
Q 5 - What is the output of following program?
IDENTIFICATION DIVISION. PROGRAM-ID. HELLO. DATA DIVISION. WORKING-STORAGE SECTION. 01 WS-NUMA PIC 9(9) VALUE 10. 01 WS-NUMB PIC 9(9) VALUE 10. 01 WS-NUMC PIC 9(9) VALUE 10. 01 WS-NUMD PIC 9(9) VALUE 100. 01 WS-NUME PIC 9(9) VALUE 10. PROCEDURE DIVISION. SUBTRACT WS-NUMA WS-NUMB WS-NUMC FROM WS-NUMD GIVING WS-NUME. DISPLAY WS-NUME. STOP RUN.
Answer : C
Explanation
The formula will be like (WS-NUME = WS-NUMD - WS-NUMA - WS-NUMB - WS-NUMC).
You can try same code using Try it option available below:
IDENTIFICATION DIVISION. PROGRAM-ID. HELLO. DATA DIVISION. WORKING-STORAGE SECTION. 01 WS-NUMA PIC 9(9) VALUE 10. 01 WS-NUMB PIC 9(9) VALUE 10. 01 WS-NUMC PIC 9(9) VALUE 10. 01 WS-NUMD PIC 9(9) VALUE 100. 01 WS-NUME PIC 9(9) VALUE 10. PROCEDURE DIVISION. SUBTRACT WS-NUMA WS-NUMB WS-NUMC FROM WS-NUMD GIVING WS-NUME. DISPLAY WS-NUME. STOP RUN.
Q 6 - What is the output of following program?
IDENTIFICATION DIVISION. PROGRAM-ID. HELLO. DATA DIVISION. WORKING-STORAGE SECTION. 01 WS-A PIC 9 VALUE 2. PROCEDURE DIVISION. A-PARA. DISPLAY 'A' GO TO B-PARA. B-PARA. DISPLAY 'B'. GO TO C-PARA D-PARA DEPENDING ON WS-A. C-PARA. DISPLAY 'C'. D-PARA. DISPLAY 'D'. STOP RUN.
Answer : B
Explanation
This is to show how control goes from one GOTO statement to other. Go step by step you will understand the flow. From B-para control will go to D-para as value in WS-A is 2, so it will go to the 2nd para which is mentioned in the GOTO statement.
You can try same code using Try it option available below:
IDENTIFICATION DIVISION. PROGRAM-ID. HELLO. DATA DIVISION. WORKING-STORAGE SECTION. 01 WS-A PIC 9 VALUE 2. PROCEDURE DIVISION. A-PARA. DISPLAY 'A' GO TO B-PARA. B-PARA. DISPLAY 'B'. GO TO C-PARA D-PARA DEPENDING ON WS-A. C-PARA. DISPLAY 'C'. D-PARA. DISPLAY 'D'. STOP RUN.
Q 7 - Which command is used to place the cursor on a specific record?
Answer : B
Explanation
Start verb can be performed only on indexed and relative files. It is used to place the file pointer at a specific record. The access mode must be sequential or dynamic. File must be opened in I-O or Input mode.
Q 8 - If usage clause is specified on a group, then all the elementary items will have the same usage clause. State whether true or false?
Answer : B
Explanation
This statement is correct.
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.
Q 10 - Decimal point position can be used with numeric data. Assumed position is the position of decimal point and not included in the data. State whether true or false?
Answer : B
Explanation
This statement is correct.
To Continue Learning Please Login
Login with Google