- 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 - Where does AREA B in COBOL start from?
Answer : B
Explanation
All COBOL statements must begin in area B which starts from 12 to 72 columns
Q 2 - Which utility is used for compiling COBOL program?
Answer : B
Explanation
IGCRCTL utility is used to compile a COBOL program.
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
Moving a alphabetic field to numeric field is illegal in COBOL. It will throw error.
Answer : B
Explanation
S9(6) USAGE is COMP-3 will take 3 bytes based on the following formula which is used to calculate when USAGE is COMP-3 :
S9(n) USAGE is COMP-3
Number of bytes = n/2 (If n is even)
Number of bytes = n/2 + 1(If n is odd, consider only integer part)
Q 6 - What is the output of following program?
IDENTIFICATION DIVISION. PROGRAM-ID. HELLO. DATA DIVISION. WORKING-STORAGE SECTION. 01 WS-CNT PIC 9(2) VALUE 0. 01 WS-STRING PIC X(15) VALUE 'AABCDACDAAEAAAF'. PROCEDURE DIVISION. INSPECT WS-STRING TALLYING WS-CNT FOR ALL 'A'. DISPLAY WS-CNT STOP RUN.
Answer : C
Explanation
Inspect statement will count the number of 'A' in the string and will put the value in WS-CNT.
You can try same code using Try it option available below:
IDENTIFICATION DIVISION. PROGRAM-ID. HELLO. DATA DIVISION. WORKING-STORAGE SECTION. 01 WS-CNT PIC 9(2) VALUE 0. 01 WS-STRING PIC X(15) VALUE 'AABCDACDAAEAAAF'. PROCEDURE DIVISION. INSPECT WS-STRING TALLYING WS-CNT FOR ALL 'A'. DISPLAY WS-CNT STOP RUN.
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 Real or Float and is represented as a single precision floating point number and internally data is stored in hexadecimal format?
Answer : D
Explanation
COMP-1 is represented as a single precision floating point number and data is internally stored in hexadecimal format.
Q 9 - In which division we write logic of the program?
Answer : A
Explanation
Procedure division is used to include the logic of the program. It consists of executable statements using variables defined in the data division. In this division, paragraph and section names are user-defined.
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
To Continue Learning Please Login
Login with Google