COBOL Programming Mock Test Quiz

Reviewed by Editorial Team
The ProProfs editorial team is comprised of experienced subject matter experts. They've collectively created over 10,000 quizzes and lessons, serving over 100 million users. Our team includes in-house content moderators and subject matter experts, as well as a global network of rigorously trained contributors. All adhere to our comprehensive editorial guidelines, ensuring the delivery of high-quality content.
Learn about Our Editorial Process
| By K Gokul
K
K Gokul
Community Contributor
Quizzes Created: 1 | Total Attempts: 12,631
| Attempts: 12,632 | Questions: 20
Please wait...
Question 1 / 20
0 %
0/100
Score 0/100
1. .    If A=10, B=20, C=30,D=0                Then the result of operation ______________                    ADD A B TO C GIVING D              

Explanation

The operation ADD A B TO C GIVING D means you add the values of A and B, then add that sum to C, and store the final result in D. The crucial point is that C is not modified; only D receives the final sum. With the initial values =10A=10, =20B=20, and =30C=30, the calculation is D=A+B+C=10+20+30=60. Thus, D is 60, while C remains unchanged.

Submit
Please wait...
About This Quiz
COBOL Programming Mock Test Quiz - Quiz

COBOL is a high-level programming language that was introduced in the 1960s. This language is commonly used in the business, finance, and administrative systems for companies and governments.... see moreWith the COBOL programming mock test almost here, it is important to keep on your feet. Take up the quiz below and see just how ready you are for it. Keep on revising!
see less

2. A data name gives references to the storage space to the memory where the actual value is stored.  

Explanation

A data name is a variable or identifier that is used to refer to a specific location in the computer's memory where a value is stored. This allows programmers to easily access and manipulate the stored value by using the data name. Therefore, the statement "A data name gives references to the storage space in the memory where the actual value is stored" is true.

Submit
3.     _______ verb causes the termination of the execution of object program.

Explanation

The STOP RUN verb is used to terminate the execution of an object program. It is typically used at the end of a program to indicate that the program has finished running and should be stopped. The STOP RUN statement is specific to COBOL programming language and is used to gracefully exit the program.

Submit
4.  A numeric literal can have maximum of 18 digits.

Explanation

A numeric literal refers to a specific value written directly in the code, without any variables or calculations. In this case, the statement suggests that a numeric literal can have a maximum of 18 digits. This means that any number written directly in the code cannot exceed 18 digits. Therefore, the answer "True" indicates that the statement is correct.

Submit
5. Which of the following is false among the statements?

Explanation

The statement "77 level can be sub divided themselves" is false. In COBOL, the 77 level is used to define elementary level items, which cannot be further subdivided. The 77 level is typically used to declare variables or data items that hold simple values like numbers or characters. On the other hand, higher levels like 88 and 66 can be used to define conditions or aliases for other data items.

Submit
6. What is the difference between COMP & COMP-3?

Explanation

The difference between COMP and COMP-3 is that COMP uses binary format to store numeric values, while COMP-3 uses packed decimal format. In binary format, each digit of the number is represented by a series of 0s and 1s, allowing for efficient storage and arithmetic operations. On the other hand, packed decimal format stores each digit of the number in a separate nibble, with the sign stored in the last nibble. This format is more space-efficient but requires additional processing to perform arithmetic operations.

Submit
7. S9(7) COMP-3 field occupy _________ bytes.  

Explanation

The S9(7) COMP-3 field is a packed decimal field that occupies 4 bytes. Packed decimal fields store numeric values in a compressed format, where each digit is represented by a nibble (half a byte). The S9(7) format indicates that the field can store up to 7 digits, including the sign. Since each digit requires a nibble, and there is an additional nibble for the sign, the total number of nibbles required is 8. However, since a nibble is half a byte, the field occupies 4 bytes.

Submit
8.    ________ clause used for the purpose allows the said area to be referred to by more than one data name with different sizes and pictures.

Explanation

The correct answer is "REDEFINES". In COBOL programming, the REDEFINES clause is used to allow a data area to be referred to by more than one data name with different sizes and pictures. This allows for efficient memory usage and flexibility in accessing and manipulating data.

Submit
9. What is the edited value of the picture clause PIC field     9999+ Numeric value moved to the field -382 and the Edited value is

Explanation

The edited value of the picture clause PIC field 9999+ after moving the numeric value -382 to the field would be 0382-. This is because the picture clause specifies that the field should have 4 digits, and the plus sign indicates that it can also have a sign. The numeric value -382 is moved to the field and the resulting edited value is 0382- where the minus sign indicates the negative sign.

Submit
10. In a COBOL program, specify the column position range of Area A                .  

Explanation

The correct answer is 8-11. In COBOL programs, the column position range of Area A is from column 8 to column 11. This means that any statements or code written in Area A should be placed within these column positions.

Submit
11. In WRITE statement, it is required to mention the record name and not the file name.

Explanation

In the WRITE statement, the record name should be mentioned instead of the file name. This means that when writing data to a file, the specific record within the file should be specified rather than just the file itself. This ensures that the data is written to the correct location within the file. Therefore, the statement is true.

Submit
12. Which division is used to specify the computer used by the program?

Explanation

The Environment Division is used to specify the computer used by the program. This division contains statements that define the characteristics of the computer system on which the program will be executed, such as the hardware configuration, operating system, and other environmental settings. It allows the program to interact with the specific computer environment in which it is running.

Submit
13. The standard left-hand alignment of alphanumeric or alphabetic data can be reversed by using the                    _________CLAUSE.

Explanation

The standard left-hand alignment of alphanumeric or alphabetic data can be reversed by using the JUSTIFIED clause.

Submit
14. A ____means the specific value which remains unchanged throughout the execution of program. 

Explanation

A LITERAL means the specific value which remains unchanged throughout the execution of the program. In programming, a literal is a value that is directly written into the code and does not change during runtime. It is used to represent fixed values such as numbers, characters, or strings. LITERALS are often used to assign initial values to variables or as operands in expressions. They are not affected by any calculations or operations performed in the program and remain constant throughout its execution.

Submit
15. The USAGE clause can be specified at any level.

Explanation

The USAGE clause in a programming language can be specified at any level, meaning it can be used in different parts of the code or at various stages of the program. This allows for flexibility and customization in how the USAGE clause is applied and utilized within the program.

Submit
16. Which of the following is valid COBOL word?

Explanation

The valid COBOL word in this question is B12-4. COBOL words can contain letters, numbers, and hyphens, but cannot start with a hyphen. Therefore, B12-4 is a valid COBOL word as it starts with a letter and includes numbers and a hyphen. The other options, –GROSS, OVER TIME, and GROSS_SALARY, are not valid COBOL words because they either contain spaces or start with a hyphen.

Submit
17. Which of the following is not a figurative constant?

Explanation

Among the options provided, QUOTE is not a figurative constant in COBOL.

Figurative constants in COBOL are special reserved words that represent specific non-numeric or alphanumeric values. They are used to initialize or manipulate data items. The other options, SPACES, BLANK, and LOW-VALUE, are all examples of figurative constants in COBOL:

SPACES represents a string of spaces.

BLANK represents a single space.

LOW-VALUE represents the lowest possible non-displayable character.

Submit
18. What is the edited value of the following                      PICTURE      Value        Internal Representation                       $$$$$            009               ______________ 

Explanation

not-available-via-ai

Submit
19. Initially A=30, B=60IF A = 40 DISPLAY 'ABC' ELSE NEXT SENTENCE END-IF MOVE 90 TO B. DISPLAY B. What is the output of the program?

Explanation

The provided COBOL program initializes two variables, A and B, with values 30 and 60, respectively. It then checks if A is equal to 40. Since A is not equal to 40, it proceeds to assign the value 90 to B and displays the value of B, which is now 90. Therefore, the output of the program is "90."

Submit
20. Which of the following is not a valid delimiter in COBOL?

Explanation

The answer is "-" because it is not a valid delimiter in COBOL. In COBOL, the valid delimiters are comma (,), period (.), and semicolon (;). The hyphen (-) is not recognized as a delimiter in COBOL.

Submit
View My Results

Quiz Review Timeline (Updated): Jun 13, 2024 +

Our quizzes are rigorously reviewed, monitored and continuously updated by our expert board to maintain accuracy, relevance, and timeliness.

  • Current Version
  • Jun 13, 2024
    Quiz Edited by
    ProProfs Editorial Team
  • Jun 25, 2011
    Quiz Created by
    K Gokul
Cancel
  • All
    All (20)
  • Unanswered
    Unanswered ()
  • Answered
    Answered ()
.    If A=10, B=20, C=30,D=0 ...
A data name gives references to the storage space to the memory where...
    _______ verb causes the termination of the...
 A numeric literal can have maximum of 18 digits.
Which of the following is false among the statements?
What is the difference between COMP & COMP-3?
S9(7) COMP-3 field occupy _________ bytes.  
   ________ clause used for the purpose allows the said area...
What is the edited value of the picture clause...
In a COBOL program, specify the column position range of Area A...
In WRITE statement, it is required to mention the record name and not...
Which division is used to specify the computer used by the program?
The standard left-hand alignment of alphanumeric or alphabetic data...
A ____means the specific value which remains unchanged throughout the...
The USAGE clause can be specified at any level.
Which of the following is valid COBOL word?
Which of the following is not a figurative constant?
What is the edited value of the following...
Initially A=30, B=60IF A = 40 ...
Which of the following is not a valid delimiter in COBOL?
Alert!

Advertisement