188k views
22 votes
Which code segment results in "true" being returned if a number is odd? Replace "MISSING CONDITION" with the correct code segment.

a) num % 2 == 0;
b) num % 2 ==1;
c) num % 1 == 0;
d) num % 0 == 2;

Which code segment results in "true" being returned if a number is odd? Replace-example-1

1 Answer

2 votes

Answer:

b) num % 2 ==1;

Step-by-step explanation:

Which code segment results in "true" being returned if a number is odd? Replace "MISSING CONDITION" with the correct code segment.

User IronicMuffin
by
4.7k points