COBOL Programming Mock Test! Hardest Trivia 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 Manjunath1987
M
Manjunath1987
Community Contributor
Quizzes Created: 7 | Total Attempts: 3,964
| Attempts: 150 | Questions: 20
Please wait...
Question 1 / 20
0 %
0/100
Score 0/100
1. S9(7) COMP-3 field occupy _________ bytes.

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.

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

Challenge yourself with the 'COBOL Programming Mock Test! Hardest Trivia Quiz' featuring questions on syntax, divisions, and operations in COBOL. Perfect for enhancing your understanding and testing your... see moreskills in this legacy programming language. see less

2. Which of the following is false among the statements?

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.

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

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.

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

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.

Submit
5. 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 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.

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

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.

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

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.

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

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.

Submit
9. Which of the following is a valid COBOL word?

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.

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

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.

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

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.

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

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.

Submit
13. 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

not-available-via-ai

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

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.

Submit
15. 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?

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.

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

Explanation

not-available-via-ai

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

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.

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

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.

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

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.

Submit
20. ________ 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

not-available-via-ai

Submit
View My Results

Quiz Review Timeline (Updated): Mar 10, 2023 +

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
Cancel
  • All
    All (20)
  • Unanswered
    Unanswered ()
  • Answered
    Answered ()
S9(7) COMP-3 field occupy _________ bytes.
Which of the following is false among the statements?
_______ verb causes the termination of the execution of object...
A  data-name gives references to the storage space to the memory...
Which division is used to specify the computer used by the program?
In WRITE statement it is required to mention the record name and not...
What is the difference between COMP & COMP-3?
What is the edited value of the following...
Which of the following is a valid COBOL word?
Which of the following is not a figurative constant?
For a Literal, Value can be changed at any stage of Program execution.
The standard left-hand alignment of alphanumeric or alphabetic data...
What is the edited value of the picture clause...
The USAGE clause can be specified at any level.
Initially A=30, B=60...
In a COBOL program column position range of Area...
Which of the following is not a valid delimiter in COBOL?
If A=10, B=20, C=30,D=0...
Definition 1 : 77 pic Number1 9(20) value 100....
________ clause used for the purpose allows the said area to be...
Alert!

Advertisement