Arithmetic Statements Interview Questions


What is Arithmetic expression?

An arithmetic expression is a user-defined formula that performs arithmetic calculations. These are combinations of variables and numbers separated by arithmetic operators.

ADD Statement -

What is the use of ADD statement?

ADD statement performs addition operations.

What are the different formats of ADD statement?

ADD statement is divided into below types based on their usage -

  • Simple ADD statement.
  • ADD with ON SIZE ERROR (Error handling).
  • ADD with GIVING.
  • ADD with CORRESPONDING.

SUBTRACT Statement -

What is the use of SUBTRACT statement?

SUBTRACT statement performs subtract operations.

What are the different formats of SUBTRACT statement?

SUBTRACT statement has below formats based on their usage -

  • Simple SUBTRACT statement.
  • SUBTRACT with GIVING.
  • SUBTRACT with ON SIZE ERROR (Error handling).
  • SUBTRACT with CORRESPONDING.

MULTIPLY Statement -

What is the use of MULTIPLY statement?

MULTIPLY statement performs multiplication operations.

What are the different formats of MULTIPLY statement?

MULTIPLY statement has three different formats on their usage -

  • Simple MULTIPLY statement.
  • MULTIPLY with ON SIZE ERROR (Error handling).
  • MULTIPLY with GIVING.

DIVIDE Statement -

What is the use of DIVIDE statement?

DIVIDE statement performs division operations.

What are the different formats of DIVIDE statement?

DIVIDE statement has below different formats based on phrases -

  • Simple DIVIDE statement.
  • DIVIDE with INTO|BY and GIVING.
  • DIVIDE with ON SIZE ERROR (Error Handling).
  • DIVIDE with INTO|BY, GIVING and REMAINDER.

COMPUTE Statement -

What is a Compute Statement?

COMPUTE is used to perform all kind of arithmetic operations in a single expression. The arithmetic operators used in COMPUTE statements are + (ADD), - (SUBTRACT), * (MULTIPLY), / (DIVIDE), and ** (EXPONENT).

Frequently Asked Questions -

What are the precedence rules for arithmetic expressions?