2023 New Spec
The algorithm, represented using pseudo-code, in Figure 3 outputs a series of integers. The output depends upon the value entered by the user.
Figure 3
OUTPUT "Enter an integer greater than 1: " INPUT Number X ← 2 Count ← 0 WHILE Number > 1 Multi ← FALSE WHILE (Number MOD X) = 0 IF NOT Multi THEN OUTPUT X ENDIF Count ← Count + 1 Multi ← TRUE Number ← Number DIV X ENDWHILE X ← X + 1 ENDWHILE OUTPUT Count
Table 3 lists the MOD and DIV operators for your programming language.
Table 3
Language | MOD | Div |
---|---|---|
C# | % | / |