- 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 - Which data type is not available in COBOL?
Answer : B
Explanation
Long data type is not available in COBOL. COBOL supports three data types Alphabetic, Numeric & Alphanumeric.
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 - In which division, Input-Output section?
Answer : B
Explanation
Input-Output section comes under Environment division which provides information about the files to be used in the program.
Answer : A
Explanation
Moving a alphabetic field to alphanumeric is legal in COBOL.
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-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 - How records are stored & accessed in sequential file organization?
Answer : B
Explanation
A sequential file consists of records that are stored and accessed in sequential order.
Q 8 - Which of the following is not a figurative constant?
Answer : B
Explanation
Comma is not a figurative constant. Figurative constants are constant values.
Q 9 - In which division we declare our variables?
Answer : C
Explanation
In Data Division we declare all the working storage variables.
Answer : D
Explanation
COMP-2 takes 8 bytes of storage.
To Continue Learning Please Login
Login with Google