Computer Science, asked by suryapc39, 2 months ago

Priya is writing a program to find whether a number is odd or even. Which operator should she use for the same.

Answers

Answered by allysia
3

Answer:

She should use modulus operator.

Explanation:

a%b (modulus  operator) returns the remainder when a is divided by b.

Consider the examples:

print (4%2) # will return 0 since 4 is divisible by 2 the remainder will be 0.

print(5%3) #will return 2 .

Similar questions