Engineering Questions with Answers - Multiple Choice Questions

# MCQs on Writing Arithmetic Expressions

1 - Question

An arithmetic expression contains one or more __________
a) Arithmetic operators
b) Logical operators
c) Relational operators
d) Short-hand operators

Explanation: Most application requires the computer to perform at least one calculation. You instruct the computer to perform calculations by writing arithmetic expression, which is an expression that contains arithmetic operators.

2 - Question

The __________ numbers indicate the order in which the computer performs the operation in an expression.
a) Precedence
b) Associativity
c) Binary
d) Ternary

Explanation: The precedence numbers indicate the order in which the computer performs the operation in an expression. Operators with precedence number 1 are performed before operations with precedence number 2, and so on.

3 - Question

You can use __________ to override the order of precedence.
a) Curly braces
b) Parenthesis
c) Third bracket
d) Associativity

Explanation: You can use parenthesis to override the precedence, because operators within parenthesis are always performed before operators outside parenthesis.

4 - Question

__________ and __________ operators use same symbol.
c) Multiplication, Division
d) Subtraction, negation

Explanation: Subtraction and negation use the same symbol that is hyphen (-), but there is a difference between both operators; since subtraction is binary operator and negation is unary operator.

5 - Question

Unary and Binary refer to the number of __________ needed by the operator.
a) Operation
b) Operand
c) Expression
d) Operator

Explanation: Unary and binary refers to the number of operands required by the operator. Unary requires single operand. Example of such is negation, such as -10, 12, -a, -b, etc. binary requires two operands. Example of such is addition, subtraction, multiplication, division, such as a+b, a-b, a*b, a/b etc.

6 - Question

When an expression contains more than one operator with same priority, then they are evaluated according their __________
a) Precedence
b) Associativity
c) Binary
d) Unary

Explanation: When an expression contains more than one operator with same priority, then they are evaluated according to their associativity. Associativity tells whether evaluation should be done from left to right or right to left for same priority operators. As we know, = and – have same priority, and both of their associativity is from left to right, thus an expression containing both + and – is evaluated from left to right.

7 - Question

The __________ operator is used to divide two integers.
b) Modulus
c) Subtraction
d) Integer division

Explanation: The integer division operator divides two integers and returns the result as an integer. For example 211\4 results into 52 whereas if you use the standard division operator then 211/4 results into 52.75 rather than 52.

8 - Question

The __________ operator returns the remainder of the division.
b) Modulus
c) Subtraction
d) Integer division

Explanation: The modulus operator is also used to divide two numbers, but the numbers need not have to be integers. After dividing the numbers the modulus operation returns the remainder of the division. For example, 211 mod 4 returns 3, which is the remainder after dividing 211 by 4.

9 - Question

To include a percentage in arithmetic operators we use __________
a) Decimal equivalent
b) Percentage symbol
c) We cannot use percentage
d) Division

Explanation: Arithmetic operators do not entertain comma or special characters, such as dollar sign or percentage. Thus to introduce the concept of percentage in an arithmetic expression we use its decimal equivalent instead of symbol such as 5%.

10 - Question

The __________ operator is commonly used to determine whether a number is even or odd.