The modulus operator is used to calculate the remainder after dividing one integer by another.
For example:
14 MOD 3 evaluates to 2
24 MOD 5 evaluates to 4
Identify one choice that shows the line number that contains a relational operator in the algorithm in Figure 1.
Figure 1
1 i ← USERINPUT
2 IF i MOD 2 = 0 THEN
3 OUTPUT i * i
4 ELSE
5 OUTPUT i
6 ENDIF
Line number 1
Line number 2
Line number 3
Line number 4
Identify one choice to show which of the following is a true statement about the algorithm in Figure 1.
This algorithm uses a Boolean operator.
This algorithm uses a named constant
This algorithm uses iteration.
This algorithm uses the multiplication operator.
Did this page help you?