COBOL Programming Mock Test Quiz

Approved & Edited by ProProfs Editorial Team
The editorial team at ProProfs Quizzes consists of a select group of subject experts, trivia writers, and quiz masters who have authored over 10,000 quizzes taken by more than 100 million users. This team includes our in-house seasoned quiz moderators and subject matter experts. Our editorial experts, spread across the world, are rigorously trained using our comprehensive guidelines to ensure that you receive the highest quality quizzes.
Learn about Our Editorial Process
| By K Gokul
K
K Gokul
Community Contributor
Quizzes Created: 1 | Total Attempts: 11,931
Questions: 20 | Attempts: 11,989

SettingsSettingsSettings
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. With 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!


Questions and Answers
  • 1. 

    Which of the following is valid COBOL word?

    • A.

      B12-4

    • B.

      –GROSS

    • C.

      OVER TIME

    • D.

      GROSS_SALARY

    Correct Answer
    A. B12-4
    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.

    Rate this question:

  • 2. 

    Which of the following is not a figurative constant?

    • A.

      SPACES

    • B.

      QUOTE

    • C.

      BLANK

    • D.

      LOW-VALUE

    Correct Answer
    B. QUOTE
    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.

    Rate this question:

  • 3. 

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

    • A.

      0382-

    • B.

      3820-

    • C.

      -0038

    • D.

      -0003

    Correct Answer
    A. 0382-
    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.

    Rate this question:

  • 4. 

    Which division is used to specify the computer used by the program?

    • A.

      Identification Division

    • B.

      Environment Division

    • C.

      Data Division

    • D.

      Procedure Division

    Correct Answer
    B. Environment Division
    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.

    Rate this question:

  • 5. 

    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?

    • A.

      30

    • B.

      60

    • C.

      90

    • D.

      Can’t perform the operation

    Correct Answer
    C. 90
    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."

    Rate this question:

  • 6. 

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

    • A.

      True

    • B.

      False

    Correct Answer
    A. True
    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.

    Rate this question:

  • 7. 

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

    • A.

      4

    • B.

      6

    • C.

      8

    • D.

      1

    Correct Answer
    A. 4
    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.

    Rate this question:

  • 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.

    • A.

      JUSTIFIED

    • B.

      REDEFINES

    • C.

      USAGE

    • D.

      SIGN

    Correct Answer
    B. REDEFINES
    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.

    Rate this question:

  • 9. 

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

    • A.

      True

    • B.

      False

    Correct Answer
    A. True
    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.

    Rate this question:

  • 10. 

    .    If A=10, B=20, C=30,D=0                Then the result of operation ______________                    ADD A B TO C GIVING D              

    • A.

      60

    • B.

      50

    • C.

      20

    • D.

      10

    Correct Answer
    A. 60
    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.

    Rate this question:

  • 11. 

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

    • A.

      STOP RUN

    • B.

      END

    • C.

      GO-BACK

    Correct Answer
    A. STOP RUN
    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.

    Rate this question:

  • 12. 

    What is the difference between COMP & COMP-3?

    • A.

      Binary format,

    • B.

      packed decimal format

    • C.

      packed decimal format & binary format,

    Correct Answer
    C. packed decimal format & binary format,
    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.

    Rate this question:

  • 13. 

    Which of the following is false among the statements?

    • A.

      77 level used for elementary level item

    • B.

      88 level used for condition.

    • C.

      77 level can be sub divided themselves

    • D.

      66 level used for RENAMES clause

    Correct Answer
    C. 77 level can be sub divided themselves
    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.

    Rate this question:

  • 14. 

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

    • A.

      LITERAL

    • B.

      GLOBAL

    • C.

      STOP RUN

    Correct Answer
    A. LITERAL
    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.

    Rate this question:

  • 15. 

    The USAGE clause can be specified at any level.

    • A.

      True

    • B.

      False

    Correct Answer
    A. True
    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.

    Rate this question:

  • 16. 

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

    • A.

      A. ,

    • B.

      .

    • C.

      ;

    • D.

    Correct Answer
    D. –
    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.

    Rate this question:

  • 17. 

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

    • A.

      8-11

    • B.

      12-80

    • C.

      0-7

    Correct Answer
    A. 8-11
    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.

    Rate this question:

  • 18. 

     A numeric literal can have maximum of 18 digits.

    • A.

      True

    • B.

      False

    Correct Answer
    A. True
    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.

    Rate this question:

  • 19. 

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

    • A.

      JUSTIFIED

    • B.

      SIGN

    • C.

      SYNCHRONIZED

    • D.

      USAGE

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

    Rate this question:

  • 20. 

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

    • A.

      Bbb$9

    • B.

      $9

    • C.

      Bbb

    • D.

      $9bbb

    Correct Answer
    A. Bbb$9

Quiz Review Timeline +

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

  • Current Version
  • Apr 09, 2024
    Quiz Edited by
    ProProfs Editorial Team
  • Jun 25, 2011
    Quiz Created by
    K Gokul
Back to Top Back to top
Advertisement
×

Wait!
Here's an interesting quiz for you.

We have other quizzes matching your interest.