- 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 - 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.
Answer : B
Explanation
10.9- is invalid because sign can not be mentioned on the right.
Answer : C
Explanation
66 level number is used for RENAMES.
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 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 - If the values of variables in the called program are modified, then their new values will reflect in the calling program. What type of call is this?
Answer : B
Explanation
The new values will reflect in the calling program when we use call by reference.
Q 8 - If usage is display, data item is stored in ASCII format and each character will take 1 byte. It is default usage. State whether true or false?
Answer : B
Explanation
This statement is correct.
Q 9 - What is the output of following program?
IDENTIFICATION DIVISION. PROGRAM-ID. HELLO. DATA DIVISION. WORKING-STORAGE SECTION. 01 WS-STRING PIC A(30) VALUE 'WELCOME TO TUTORIALSPOINT'. 01 WS-STR1 PIC A(7). 01 WS-STR2 PIC A(2). 01 WS-STR3 PIC A(15). 01 WS-COUNT PIC 99 VALUE 1. PROCEDURE DIVISION. UNSTRING WS-STRING DELIMITED BY SPACE INTO WS-STR1, WS-STR2, WS-STR3 END-UNSTRING. DISPLAY WS-STR2. STOP RUN.
Answer : B
Explanation
Unstring verb is used to split one string into multiple sub-strings.
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 A(30) VALUE 'WELCOME TO TUTORIALSPOINT'. 01 WS-STR1 PIC A(7). 01 WS-STR2 PIC A(2). 01 WS-STR3 PIC A(15). 01 WS-COUNT PIC 99 VALUE 1. PROCEDURE DIVISION. UNSTRING WS-STRING DELIMITED BY SPACE INTO WS-STR1, WS-STR2, WS-STR3 END-UNSTRING. DISPLAY WS-STR2. STOP RUN.
Answer : D
Explanation
(9+1)/2 = 5 bytes.