- 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 - What does COBOL stand for?
A - Common Business Oriented Language
B - Common Business Object Language
Answer : A
Explanation
COBOL stands for COmmon Business Oriented Language which was developed to automate the business process.
Q 2 - If 436 value is moved to a PP999 PIC clause, then what is edited value taken?
Answer : A
Explanation
P is assumed decimal scaling position which is used to specify the location of an assumed decimal point when the point is not within the number that appears in the data item. .PIC PP999 means that numeric data item is of 3 characters and there are 5 positions after the decimal point.
Q 3 - What is the position of Area B in COBOL program?
Answer : C
Explanation
Area B start from 12 to 72 column. All COBOL statements must begin in area B.
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. DATA DIVISION. WORKING-STORAGE SECTION. 01 WS-NUMA PIC 9(9) VALUE 100. 01 WS-NUMB PIC 9(9) VALUE 15. 01 WS-NUMC PIC 9(2). 01 WS-REM PIC 9(2). PROCEDURE DIVISION. DIVIDE WS-NUMA BY WS-NUMB GIVING WS-NUMC REMAINDER WS-REM. DISPLAY WS-NUMC ', ' WS-REM STOP RUN.
Answer : A
Explanation
Formula will be like WS-NUMC = NUMA/NUMB and remainder will be stored in WS-REM.
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 100. 01 WS-NUMB PIC 9(9) VALUE 15. 01 WS-NUMC PIC 9(2). 01 WS-REM PIC 9(2). PROCEDURE DIVISION. DIVIDE WS-NUMA BY WS-NUMB GIVING WS-NUMC REMAINDER WS-REM. DISPLAY WS-NUMC ', ' WS-REM STOP RUN.
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 OCCURS 3 TIMES.
10 WS-B PIC A(2).
10 WS-C OCCURS 2 TIMES.
15 WS-D PIC X(3).
PROCEDURE DIVISION.
MOVE '12ABCDEF34GHIJKL56MNOPQR' TO WS-TABLE.
DISPLAY 'WS-C(3,1) : ' WS-C(3,1).
STOP RUN.
Answer : D
Explanation
It is a 2-D array and we are using subscript to the access the elements in the table. WS-C(3,1) has MNO value in it.ws
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 OCCURS 3 TIMES.
10 WS-B PIC A(2).
10 WS-C OCCURS 2 TIMES.
15 WS-D PIC X(3).
PROCEDURE DIVISION.
MOVE '12ABCDEF34GHIJKL56MNOPQR' TO WS-TABLE.
DISPLAY 'WS-C(3,1) : ' WS-C(3,1).
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 - 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.
Q 10 - Elementary items cannot be divided further. Level number, Data name, Picture clause and Value clause (optional) are used to describe an elementary item. State whether true or false?
Answer : A
Explanation
This statement is correct.
