Show List
Quiz - COBOL - 1
Select the right answer for below questions:
Which division of a COBOL program is used to define the layout of input and output files?
DATA DIVISION
IDENTIFICATION DIVISION
ENVIRONMENT DIVISION
PROCEDURE DIVISION
ENVIRONMENT DIVISION
Which of the following is not a basic data type in COBOL?
INTEGER
DECIMAL
FLOAT
BOOLEAN
BOOLEAN
What is the maximum length of a variable name in COBOL?
8 characters
12 characters
16 characters
20 characters
20 characters
In COBOL, what is the syntax for declaring a variable named “SALES” of type “DECIMAL” with a precision of 9 and a scale of 2?
01 SALES PIC 9V99.
01 SALES PIC S9V99.
01 SALES PIC 9(9).99.
01 SALES PIC S9(9).99.
01 SALES PIC 9(9).99.
Which of the following is not a COBOL reserved word?
DISPLAY
MOVE
PERFORM
DEFINE
DEFINE
What is the purpose of the “INITIAL” keyword in a COBOL data definition?
To initialize the variable to a default value
To indicate that the variable is a pointer
To indicate that the variable is an array
To declare a variable constant
To initialize the variable to a default value
In COBOL, what is the maximum number of levels that can be defined in a data structure?
5
7
9
11
7
In COBOL, what is the syntax for defining a table named “SALES-TABLE” with 100 elements, each of type “DECIMAL” with a precision of 9 and a scale of 2?
01 SALES-TABLE OCCURS 100 TIMES PIC 9V99.
01 SALES-TABLE OCCURS 100 TIMES PIC S9V99.
01 SALES-TABLE OCCURS 100 TIMES PIC 9(9).99.
01 SALES-TABLE OCCURS 100 TIMES PIC S9(9).99.
01 SALES-TABLE OCCURS 100 TIMES PIC 9(9).99.
Which of the following is not a COBOL arithmetic operator?
+
-
*
^
^
What is the purpose of the “EXIT” statement in COBOL?
To exit a loop or perform block
To terminate the program
To jump to a different section of code
To return a value from a function
To terminate the program
Submit
Retry
{"qz1-538889":"ENVIRONMENT DIVISION","qz1-538890":"BOOLEAN","qz1-538891":"20 characters","qz1-538892":"01 SALES PIC 9(9).99.","qz1-538893":"DEFINE","qz1-538894":"To initialize the variable to a default value","qz1-538895":"7","qz1-538896":"01 SALES-TABLE OCCURS 100 TIMES PIC 9(9).99.","qz1-538897":"^","qz1-538898":"To terminate the program"}
Leave a Comment