In the following code segment, assume that x and y have been assigned integer values.
sum ← 0
REPEAT x TIMES
{
REPEAT y TIMES
{
sum ← sum + 1
}
}
At the end of which of the following code segments is the value of sum the same as the value of sum at the end of the preceding code segment? select two answer
a. )
sum ←← 0
z ←← x y
REPEAT z TIMES
{
sum ←← sum + 1
}
b. )
sum ←← 0
REPEAT y TIMES
{
REPEAT x TIMES
{
sum ←← sum + 1
}
}
c. )
sum ←← 9
REPEAT y TIMES
{
REPEAT x TIMES
{
sum ←← sum + 1
}
d. )
sum ←← 12
REPEAT y TIMES
{
REPEAT x TIMES
{
sum ←← sum + 1
}
}