0

programming languages Online Quiz - 234

Description: programming languages Online Quiz - 234
Number of Questions: 20
Created by:
Tags: programming languages
Attempted 0/20 Correct 0 Score 0

The maximum value of the integer argument to the FACTORIAL function when you specify ARITH (COMPAT) is?

  1. (a) 20

  2. (b) 29

  3. (c) 28

  4. (d) 18


Correct Option: C

AI Explanation

To answer this question, we need to understand the properties and limitations of the FACTORIAL function when using ARITH (COMPAT).

The FACTORIAL function calculates the factorial of a given integer. The factorial of a non-negative integer n, denoted by n!, is the product of all positive integers less than or equal to n. For example, 5! = 5 × 4 × 3 × 2 × 1 = 120.

When using ARITH (COMPAT), the maximum value of the integer argument to the FACTORIAL function is limited by the size of the data type used to store the result. In this case, we can assume that the data type used can store values up to its maximum value.

From the given options, we need to determine the maximum value that the FACTORIAL function can handle.

Option A) 20 - This option suggests that the maximum value is 20.

Option B) 29 - This option suggests that the maximum value is 29.

Option C) 28 - This option suggests that the maximum value is 28.

Option D) 18 - This option suggests that the maximum value is 18.

The correct answer is option C) 28. This option is correct because the maximum value of the integer argument to the FACTORIAL function when using ARITH (COMPAT) is 28.

In CODEPAGE(ccsid),what is full form of CCSID?

  1. (a) coded character set identifier

  2. (b) character code set identifier

  3. (c) codepage character set identifier

  4. (d) coded character statement identifier


Correct Option: A

AI Explanation

To answer this question, let's go through each option to understand why it is correct or incorrect:

Option A) (a) coded character set identifier - This option is correct because CCSID stands for "Coded Character Set Identifier." It is a numerical value that identifies a specific character set or code page.

Option B) (b) character code set identifier - This option is incorrect. While it is similar to the correct answer, it does not accurately represent the acronym CCSID.

Option C) (c) codepage character set identifier - This option is incorrect. It does not accurately represent the acronym CCSID.

Option D) (d) coded character statement identifier - This option is incorrect. It does not accurately represent the acronym CCSID.

The correct answer is A) (a) coded character set identifier. This option is correct because CCSID stands for "Coded Character Set Identifier," which is a numerical value used to identify a specific character set or code page.

LIB compiler option must be in effect for which of the following statements?

  1. (a) Basis

  2. (b) Copy

  3. (c) Replace

  4. (d) All of the above


Correct Option: D

Use MAP to produce a listing of the items defined in the

  1. (a) Identification division

  2. (b) Data division

  3. (c) Environment division

  4. (d) Program division


Correct Option: B

AI Explanation

To answer this question, we need to understand the different divisions in a typical COBOL program and the purpose of each division.

A COBOL program is divided into four divisions, each serving a specific purpose:

(a) Identification Division: This division contains information about the program, such as its name, author, date, and purpose. It does not define any items.

(b) Data Division: This division defines the data items used in the program, including variables, files, and records. It is the division responsible for declaring and describing the data used in the program.

(c) Environment Division: This division contains information about the environment in which the program will be executed, such as file names, device names, and system-dependent features. It does not define any items.

(d) Procedure Division: This division contains the actual program logic and instructions that perform the desired processing. It does not define any items.

From the given options, we are asked to use MAP to produce a listing of the items defined in the divisions. The only division that defines items is the Data Division (option B).

Therefore, the correct answer is B) (b) Data Division. This option is correct because the Data Division is responsible for defining the data items used in the program.

You will introduce errors if the number of data-names in the identifier list of a called program is greater than the number of arguments passed from the calling program

  1. True

  2. False


Correct Option: A

By what way we can pass data between programs?

  1. (a) By Reference

  2. (b) By Content

  3. (c) By Value

  4. (d) All of the above


Correct Option: D

To pass a copy of the identifier to the subprogram --- code can be used?

  1. (a) CALL . . . BY CONTENT literal

  2. (b) CALL . . . BY CONTENT identifier

  3. (c) CALL . . . BY CONTENT ADDRESS OF identifier

  4. (d) CALL . . . BY CONTENT ADDRESS OF identifier


Correct Option: B

To call a C/C++ function with a function return value

  1. (a) CALL . . . RETURNING

  2. (b) CALL . . . RECURRING

  3. (c) CALL . . . RECURSIVE

  4. (d) CALL . . . REFERRING


Correct Option: A

AI Explanation

To call a C/C++ function with a function return value, the correct option is A) (a) CALL . . . RETURNING.

Explanation: In C/C++, when you want to call a function and use its return value, you can use the syntax:

return_type variable = function_name(arguments);

For example, if you have a function named add that takes two integers as arguments and returns their sum, you can call it and store the result in a variable like this:

int result = add(3, 5);

In this case, the function add is called with the arguments 3 and 5, and the return value is assigned to the variable result.

Therefore, the correct option is A) (a) CALL . . . RETURNING.

We need to use ----- to get a sorted cross-reference listing

  1. (a) XNOX

  2. (b) XREFER

  3. (c) XSCR

  4. (d) XREF


Correct Option: D

AI Explanation

To get a sorted cross-reference listing, we need to use the utility program called XREF.

Let's go through each option to understand why it is correct or incorrect:

Option A) (a) XNOX - This option is incorrect because XNOX is not the correct utility program for a cross-reference listing.

Option B) (b) XREFER - This option is incorrect because XREFER is not the correct utility program for a cross-reference listing.

Option C) (c) XSCR - This option is incorrect because XSCR is not the correct utility program for a cross-reference listing.

Option D) (d) XREF - This option is correct because XREF is the utility program that is used to get a sorted cross-reference listing.

The correct answer is Option D. This option is correct because XREF is the utility program that is specifically designed to generate a sorted cross-reference listing.

The only difference between DECK and OBJECT is in the ------

  1. (a) linkage editor

  2. (b) dataset name

  3. (c) routing of datasets

  4. (d) binder


Correct Option: C

AI Explanation

To answer this question, we need to understand the difference between DECK and OBJECT in the context of computer programming or data processing.

DECK refers to a deck of punched cards, which was a common method of storing and processing data in early computer systems. The deck would contain a sequence of punched cards, each representing a specific instruction or data item.

OBJECT, on the other hand, refers to an executable file or program that has been compiled or assembled from the source code. The object file contains machine code instructions that can be directly executed by the computer.

The only difference between DECK and OBJECT is in the routing of datasets. In other words, DECK represents a dataset that contains a sequence of punched cards, while OBJECT represents a dataset that contains machine code instructions.

Let's go through each option to understand why it is correct or incorrect:

Option A) (a) linkage editor - This option is incorrect because the linkage editor is not related to the difference between DECK and OBJECT. The linkage editor is a program that resolves external references and combines multiple object files into a single executable program.

Option B) (b) dataset name - This option is incorrect because the dataset name does not differentiate between DECK and OBJECT. The dataset name is simply a label or identifier used to reference a specific dataset.

Option C) (c) routing of datasets - This option is correct because the routing of datasets is the only difference between DECK and OBJECT. DECK represents a dataset containing punched cards, while OBJECT represents a dataset containing machine code instructions.

Option D) (d) binder - This option is incorrect because the binder is not directly related to the difference between DECK and OBJECT. The binder is a program that combines multiple object files and libraries into a single executable program or module.

The correct answer is C) (c) routing of datasets. This option is correct because the only difference between DECK and OBJECT is in the routing of datasets, with DECK representing punched cards and OBJECT representing machine code instructions.

Default BUFSIZE is ?

  1. (a) 1024

  2. (b) 4024

  3. (c) 256

  4. (d) 4096


Correct Option: D

AI Explanation

To answer this question, we need to understand what the term "BUFSIZE" refers to and what its default value is.

BUFSIZE typically refers to the size of a buffer, which is a temporary storage area used to hold data while it is being transferred from one location to another. The default BUFSIZE value is the default size allocated for this buffer.

The correct answer is D) 4096. This option is correct because the default BUFSIZE is commonly set to 4096 bytes.

When conflicting options are specified at the same level in the hierarchy -------- option takes effect.

  1. (a) the option specified last

  2. (b) the option specified first

  3. (c) both options takes effect

  4. (d) both options will not takes effect


Correct Option: A

In the syntax WORD(xxxx) what do xxxx specifies?

  1. (a) starting characters of the name of the reserved-word table

  2. (b) ending characters of the name of the reserved-word table

  3. (c) alternate characters of the name of the reserved-word table

  4. (d) All of the above


Correct Option: A

Can we use the LANGUAGE compiler option and the NATLANG runtime option to act independently of each other.

  1. True

  2. False


Correct Option: A

The DATA option affects whether storage for dynamic data areas and other dynamic runtime storage is obtained from above or below the ------line

  1. (a) 8MB

  2. (b) 31MB

  3. (c) 16MB

  4. (d) 20MB


Correct Option: C

For conversions that lose precision - When a USAGE COMP-1 data item is moved to a FIXED-POINT data item that has more than nine digits, the fixed-point data item will receive only -- significant digits, and the remaining digits will be ----.

  1. (a) 18 , zero

  2. (b) zero , 18

  3. (c) zero , 9

  4. (d) 9 , zero


Correct Option: D

AI Explanation

To answer this question, you need to understand the concept of conversions that lose precision in COBOL.

In COBOL, the COMP-1 data type represents a single-precision floating-point number. It is typically used to store numbers with a decimal point and a fractional part. On the other hand, the FIXED-POINT data type represents a fixed-point number with a specified number of digits before and after the decimal point.

When a COMP-1 data item is moved to a FIXED-POINT data item that has more than nine digits, the fixed-point data item will receive only nine significant digits, and the remaining digits will be zero.

Let's go through each option to understand why it is correct or incorrect:

Option A) (a) 18, zero - This option is incorrect because the fixed-point data item receives only nine significant digits, not 18.

Option B) (b) zero, 18 - This option is incorrect because the fixed-point data item receives only nine significant digits, not 18.

Option C) (c) zero, 9 - This option is incorrect because the fixed-point data item receives only nine significant digits, not zero.

Option D) (d) 9, zero - This option is correct because the fixed-point data item receives only nine significant digits, and the remaining digits are zero.

Therefore, the correct answer is option D. The fixed-point data item will receive nine significant digits, and the remaining digits will be zero.

DBRM stands for ?

  1. (a) database request module

  2. (b) database resourse module

  3. (c) databind request module

  4. (d) databind resourse module


Correct Option: A

AI Explanation

To answer this question, you need to understand the acronym DBRM.

DBRM stands for Database Request Module.

Let's go through each option to understand why it is correct or incorrect:

Option A) (a) database request module - This option is correct because it accurately represents the acronym DBRM.

Option B) (b) database resource module - This option is incorrect because it does not accurately represent the acronym DBRM.

Option C) (c) databind request module - This option is incorrect because it does not accurately represent the acronym DBRM.

Option D) (d) databind resource module - This option is incorrect because it does not accurately represent the acronym DBRM.

The correct answer is A) (a) database request module. This option is correct because it accurately represents the acronym DBRM.

RMODE stands for ?

  1. (a) Remote mode

  2. (b) Regression mode

  3. (c) Recession mode

  4. (d) Residency mode


Correct Option: D

AI Explanation

To answer this question, we need to understand what RMODE stands for.

RMODE stands for Residency mode.

Option A) Remote mode - This option is incorrect because RMODE does not stand for Remote mode. Option B) Regression mode - This option is incorrect because RMODE does not stand for Regression mode. Option C) Recession mode - This option is incorrect because RMODE does not stand for Recession mode. Option D) Residency mode - This option is correct because RMODE stands for Residency mode.

Therefore, the correct answer is option D) Residency mode.

What is the clause we use to access the file between two programs as a common file ?

  1. (1) Use the SYNCHRONIZED clause for the file.

  2. (2) Use the EXTERNAL clause for the file.

  3. (3) Use GLOBAL clause for the file.

  4. (4) Use COMMON clause for the file.


Correct Option: B

AI Explanation

To access a file between two programs as a common file, we use the EXTERNAL clause for the file.

Let's go through each option to understand why it is correct or incorrect:

Option A) Use the SYNCHRONIZED clause for the file. This option is incorrect because the SYNCHRONIZED clause is used to ensure that only one program can access a file at a time, preventing concurrent access.

Option B) Use the EXTERNAL clause for the file. This option is correct because the EXTERNAL clause allows multiple programs to access a file as a common file. It allows sharing of data between programs.

Option C) Use the GLOBAL clause for the file. This option is incorrect because the GLOBAL clause is used to share data between programs within the same run unit, not between different programs.

Option D) Use the COMMON clause for the file. This option is incorrect because the COMMON clause is used to define shared variables within a program, not to access a file as a common file between programs.

The correct answer is Option B) Use the EXTERNAL clause for the file. This option is correct because it allows multiple programs to access the file as a common file.

- Hide questions