C-17-Q098mediumsingle_mcq
The condition used inside the loop to detect odd numbers is:
The condition used inside the loop to detect odd numbers is:
- a
i % 2 == 0 - b
i % 2 != 0 - c
i // 2 == 0 - d
i % 3 == 0
ব্যাখ্যা
A number is odd when it leaves a remainder when divided by 2, i.e. i % 2 != 0. The condition i % 2 == 0 would instead detect even numbers.