din bher ki sab batein saray kaam tumharay naam…
jab se likhi hai mein ne har ik shaam tumharay naam…
duniya ke baazar mein apni, kia Qeemut hai phir bhi…
jo bhi mil saktay hon mere, daam tumharay naam
if (X >= 5) && (X <= 9)
Y = X - (((X mod% 5) << 1) - 1);
Those who are not familiar with C code, here is the explaination:
The method is to first x mod 5, then multply it by 2 and then subract 1 from it. And then subtract the result from original X. :-P
Hehe! Correct but an overkill!
It just proves that its not the question but how you ask it that matters. He was laughing like hmcq when I told him the simpler version. Phew! He wasn't mad.
p.s: The modulus (mod), or remainder, divides number1 by number2 and returns only the remainder as result!