COBOL Programming Language Quiz! Exam

12 Questions | Total Attempts: 204

SettingsSettingsSettings
COBOL Quizzes & Trivia

This quiz is designed to help test Your Knowledge about COBOL Programming Language. This programming language is not used so much today and is not supported by most systems, but it cannot be completely forgotten. It was created to help businesses in their administrative processes. How about you refresh your understanding of the language by taking this quiz!


Questions and Answers
  • 1. 
    What is the output of the code below? IDENTIFICATION DIVISION. PROGRAM-ID. HELLO. DATA DIVISION.    WORKING-STORAGE SECTION.    01 WS-STRING PIC A(30) VALUE 'WELCOME TO COBOL WORLD'.    01 WS-STR1 PIC A(7).    01 WS-STR2 PIC A(2).    01 WS-STR3 PIC A(15).    01 WS-COUNT PIC 99 VALUE 1. PROCEDURE DIVISION.    UNSTRING WS-STRING DELIMITED BY SPACE       INTO WS-STR1, WS-STR2, WS-STR3    END-UNSTRING.       DISPLAY WS-STR2.    STOP RUN.
    • A. 

      WELCOME

    • B. 

      TO

    • C. 

      TO COBOL WORLD

    • D. 

      WELCOMETOCOBOLWORLD

  • 2. 
    What is the output of the following program? IDENTIFICATION DIVISION. PROGRAM-ID. HELLO.   DATA DIVISION.    WORKING-STORAGE SECTION.    01 WS-TABLE.       05 WS-A OCCURS 3 TIMES.          10 WS-B PIC A(2).          10 WS-C OCCURS 2 TIMES.             15 WS-D PIC X(3).   PROCEDURE DIVISION.    MOVE '12ABCDEF34GHIJKL56MNOPQR' TO WS-TABLE.    DISPLAY 'WS-C(3,1) : ' WS-C(3,1).    STOP RUN.
    • A. 

      DEF

    • B. 

      ABC

    • C. 

      PQR

    • D. 

      MNO

  • 3. 
    How many times following loop will execute? MOVE 5 TO X. PERFORM X TIMES MOVE 10 TO X END-PERFORM.
    • A. 

      11

    • B. 

      5

    • C. 

      10

    • D. 

      15

  • 4. 
    If after an arithmetic operation, the result exceeds the largest value that can be accommodated in the result field, the error is called a [Blank].
  • 5. 
    The [Blank] clause eliminates the need for separate entries for the repeated data items.      A. REDEFINES      B. RENAME      C. USAGE      D. OCCURS
  • 6. 
    If initially A=30 and B=60 then execute the statement bellow                                 MOVE A B TO C. What is the resultant of C?
    • A. 

      30

    • B. 

      60

    • C. 

      90

    • D. 

      Syntax error

  • 7. 
    PERFORM P2           VARYING I FROM 1 BY 1 UNTIL I <10 END-PERFORM. How many times P2 will be executed?
    • A. 

      10

    • B. 

      11

    • C. 

      0

    • D. 

      1

  • 8. 
       MOVE 123456789 TO WS-NUM1.    MOVE WS-NUM1(3:6) TO WS-NUM2.     DISPLAY WS-NUM2 What is the output of the DISPLAY?
    • A. 

      345678

    • B. 

      123456

    • C. 

      000000

    • D. 

      456789

  • 9. 
    After the execution of one of the when clauses, the control is automatically passed on to the next sentence after the EVALUATE statement. There is no need for any extra code.
    • A. 

      True

    • B. 

      False

  • 10. 
    LINKAGE-SECTION present which DIVISION?
    • A. 

      IDENTIFICATION DIVISION

    • B. 

      ENVIRONMENT DIVISION

    • C. 

      DATA DIVISION

    • D. 

      PROCEDURE DIVISION

  • 11. 
    Every Data name used in the program must be defined in PROCEDURE DIVISION.
    • A. 

      True

    • B. 

      False

  • 12. 
    PERFORM with [Blank] phase executes the number of times specified by the value in identifier or Integer. A. UNTIL B. THRU C. END-PERFORM D. TIMES 
Back to Top Back to top