Multiple choice cobol

Which one of the following is incorrect

  1. Divide A into B

  2. Divide A by B

  3. Divide A into B Giving C

  4. Divide A by B Giving C

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

In COBOL, 'DIVIDE A BY B' is incorrect because the standard syntax is 'DIVIDE A INTO B' (where B is the dividend) or 'DIVIDE A BY B GIVING C'. 'DIVIDE A BY B' without a 'GIVING' clause is invalid.

AI explanation

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

Option A) Divide A into B - This option is correct because it implies that A is being divided into equal parts, with B representing the number of parts.

Option B) Divide A by B - This option is incorrect because it does not specify the result of the division. It is missing the information about what the division is giving or producing.

Option C) Divide A into B Giving C - This option is correct because it specifies that A is being divided into B equal parts and the result of the division is C.

Option D) Divide A by B Giving C - This option is correct because it specifies that A is being divided by B, and the result of the division is C.

The correct answer is B.