COBOL Programming Mock Test! Hardest Trivia 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 Manjunath1987
M
Manjunath1987
Community Contributor
Quizzes Created: 7 | Total Attempts: 3,867
Questions: 20 | Attempts: 141

SettingsSettingsSettings
COBOL Programming Mock Test! Hardest Trivia Quiz - Quiz

.


Questions and Answers
  • 1. 

    Which of the following is a 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 the given options is B12-4. COBOL words can consist of letters, digits, and hyphens, but they cannot start with a hyphen. Therefore, options like –GROSS- and OVER TIME are not valid COBOL words. GROSS_SALARY is also not a valid COBOL word because COBOL does not allow the use of underscores in word names.

    Rate this question:

  • 2. 

    Which of the following is not a figurative constant?

    • A.

      SPACES

    • B.

      QUOTE

    • C.

      BLANK

    • D.

      LOW-VALUE

    Correct Answer
    C. BLANK
    Explanation
    The other options, SPACES, QUOTE, and LOW-VALUE, are all figurative constants commonly used in programming languages. These constants represent specific characters or values. However, BLANK is not a recognized figurative constant in most programming languages.

    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                               

    Correct Answer
    0382-
  • 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 information about the hardware and software environment in which the program runs, such as the computer type, operating system, and input/output devices. It helps the program to interact with the specific computer system and perform necessary operations.

    Rate this question:

  • 5. 

    Initially A=30, B=60  IF 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
    B. 60
    Explanation
    The output of the program is 60. Initially, the values of A and B are 30 and 60 respectively. Since A is not equal to 40, the program goes to the ELSE statement and skips the NEXT SENTENCE. Then, the value 90 is moved to B. Finally, the program displays the value of B, which is 60.

    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
    The explanation for the correct answer is that in a WRITE statement, it is necessary to specify the name of the record being written, rather than the name of the file. This is because a file can contain multiple records, and the WRITE statement is used to write data into a specific record within the file. By mentioning the record name, the program knows exactly where to write the data.

    Rate this question:

  • 7. 

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

    Correct Answer
    4
    Explanation
    The S9(7) COMP-3 field is a packed decimal field that occupies 4 bytes of storage. Packed decimal fields store numeric data in a compressed format, where each digit is represented by a nibble (half a byte). The S9(7) format indicates that the field can hold a signed numeric value with a maximum of 7 digits. Since each digit requires a nibble, and each byte can hold 2 nibbles, the field requires a total of 4 bytes of storage.

    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
    A. JUSTIFIED
  • 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 reference that points to the specific memory location where the actual value is stored. This means that when we use a data-name, we are actually accessing the value stored in the memory location it refers to. Therefore, the statement is true.

    Rate this question:

  • 10. 

    If A=10, B=20, C=30,D=0 ADD A B TO C GIVING D Then the respective Values of D and C ______________ 

    • A.

      60,60

    • B.

      30,60

    • C.

      60,50

    • D.

      50,50

    • E.

      60,30

    Correct Answer
    E. 60,30
    Explanation
    The given equation "ADD A B TO C GIVING D" means that the values of A and B should be added together and the result should be stored in C. In this case, A=10 and B=20, so when we add them together, we get C=30. Therefore, the value of C is 30. Additionally, the "GIVING D" part means that the value of C should also be stored in D. So, the value of D is also 30. Therefore, the respective values of D and C are 30, 30.

    Rate this question:

  • 11. 

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

    Correct Answer
    STOP RUN
    Explanation
    The verb "STOP RUN" is used in programming languages like COBOL to terminate the execution of the object program. It is typically placed at the end of the program to indicate that the program has finished running and should stop executing.

    Rate this question:

  • 12. 

    What is the difference between COMP & COMP-3?

    • A.

      COMP represents data(Value) in Decimal form, COMP-3 represents in Binary format

    • B.

      COMP represents data(Value) in Packed Decimal form, COMP-3 represents in Binary format

    • C.

      COMP represents data(Value) in Binary format, COMP-3 represents in Packed Decimal format

    • D.

      None of the above

    Correct Answer
    C. COMP represents data(Value) in Binary format, COMP-3 represents in Packed Decimal format
    Explanation
    The correct answer is that COMP represents data(Value) in Binary format, while COMP-3 represents data(Value) in Packed Decimal format. COMP is used to store integer values in binary form, while COMP-3 is used to store decimal values in packed decimal format. Packed decimal format allows for efficient storage of decimal numbers, as each digit is stored in a nibble (half a byte), reducing the amount of space required compared to storing each digit in a full byte.

    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 level number 77 is used to define elementary level items, which cannot be further subdivided. Elementary level items are used to define individual data items such as numbers or characters. On the other hand, higher level numbers like 01, 02, or 88 can be used to define group items or condition names.

    Rate this question:

  • 14. 

    For a Literal, Value can be changed at any stage of Program execution.

    • A.

      True

    • B.

      False

    Correct Answer
    B. False
    Explanation
    The statement is false because for a literal, the value cannot be changed at any stage of program execution. A literal is a fixed value that is directly written in the code and its value remains constant throughout the program. It is not possible to modify or update the value of a literal during program 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, which means it can be used in different parts of the code, such as at the global level or within specific functions or blocks. This allows for flexibility in declaring and utilizing variables or resources throughout the program. Therefore, the statement that the USAGE clause can be specified at any level is true.

    Rate this question:

  • 16. 

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

    • A.

      , (comma)

    • B.

      . (Period)

    • C.

      ; (Semicolon)

    • D.

      (Space)

    • E.

      - (Hyphen)

    Correct Answer
    C. ; (Semicolon)
    Explanation
    In COBOL, the semicolon (;) is not a valid delimiter. Delimiters are used to separate different elements in a program, such as statements or data items. In COBOL, the valid delimiters are comma (,), period (.), and space. The semicolon is not recognized as a delimiter in COBOL and would result in a syntax error if used.

    Rate this question:

  • 17. 

    In a COBOL program column position range of Area A...................               

    • A.

      7-11

    • B.

      12-72

    • C.

      72-80

    • D.

      8-12

    • E.

      None of the above

    Correct Answer
    E. None of the above
  • 18. 

    Definition 1 : 77 pic Number1 9(20) value 100. Definition 2:  02 pic Number2 z(6) value 200.

    • A.

      Both Definition 1 and Definition 2 are wrong

    • B.

      Definition 1 is correct, Definition 2 is Wrong

    • C.

      Definition 1 is Wrong, Definition 2 is Correct

    • D.

      Both the definitions are Correct

    Correct Answer
    C. Definition 1 is Wrong, Definition 2 is Correct
    Explanation
    Definition 1 is wrong because the data type specified, "pic Number1 9(20)", is not a valid syntax. On the other hand, Definition 2 is correct because the data type specified, "pic Number2 z(6)", is a valid syntax.

    Rate this question:

  • 19. 

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

    • A.

      SYNCHRONIZED

    • B.

      JUSTIFIED

    • C.

      USAGE

    • D.

      ALIGN

    • E.

      SIGN

    Correct Answer
    B. JUSTIFIED
    Explanation
    The correct answer is JUSTIFIED. In standard left-hand alignment, alphanumeric or alphabetic data is aligned to the left margin. However, by using the JUSTIFIED clause, the alignment can be reversed, and the data will be aligned to the right margin.

    Rate this question:

  • 20. 

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

    • A.

      BBBB9$ (Where B represents single blank space)

    • B.

      BBB$9 (Where B represents single blank space)

    • C.

      $$$$$

    • D.

      BBBB9 (Where B represents single blank space)

    • E.

      BBB9$ (Where B represents single blank space)

    Correct Answer
    B. BBB$9 (Where B represents single blank space)
    Explanation
    The edited value of the given PICTURE is BBB$9. This is because the original value of PICTURE contains 5 characters ($$$$$), but the internal representation contains only 3 characters (009). Therefore, to match the internal representation, the value of PICTURE needs to be edited to BBB$9, where B represents a single blank space.

    Rate this question:

Quiz Review Timeline +

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

  • Current Version
  • Mar 10, 2023
    Quiz Edited by
    ProProfs Editorial Team
  • May 12, 2011
    Quiz Created by
    Manjunath1987
Back to Top Back to top
Advertisement
×

Wait!
Here's an interesting quiz for you.

We have other quizzes matching your interest.