The statement

while (--counter >= 1) {
printf("%s\n", counter % 2 ? "even" : "odd");
}
can not be rewritten as
a)
while (--counter >= 1) {
if (counter % 2) {
puts("even");
}
else {
puts("odd");
}
}
b)
while (counter >= 1) {
if (counter % 2) {
puts("even");
}
else {
puts("odd");
}
}
--counter;
c)
while (counter >= 1) {
if (counter % 2) {
puts("even");
}
else {
puts("odd");
}
--counter;
}
d)
do {
printf("%s\n", counter % 2 ? "odd" : "even");
--counter;
} while (counter >= 2);

b)
while (counter >= 1) {
if (counter % 2) {
puts("even");
}
else {
puts("odd");
}
}
--counter;

Computer Science & Information Technology

You might also like to view...

Which of the following network infrastructure implementations would be used to support files being transferred between Bluetooth-enabled smartphones?

A. PAN B. LAN C. WLAN D. MAN

Computer Science & Information Technology

Which statement is a valid local variable declaration in Alice?

A. distanceToHorse = Double (1.0); B. Double distanceToHorse (1.0);  C. Double distanceToHorse = 1.0;  D. distanceToHorse (Double, 1.0); 

Computer Science & Information Technology