← All problemsSign in

Even or Odd

Kewal just returned from school where he learned that “if the last digit of a number is divisible by 2,then it is an even number.” However he forgot that this property holds only for integers.Anyways to keep him happy, we would consider his ideology for floating point numbers as well. Thus we would have Thus we would have 12.6 as even(last digit even(6)) 12.7 as odd(last digit odd(7)) 12.70 a

HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17

CodeSearch Tutor

Hints, not spoilers — it won’t hand over the full solution unless you insist.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start