^ Click Here

Friday, February 25, 2011

To Check Odd/Even without Modulus Operator (%)

Many Times the situation may arise when you won't have to use modulus operator(for one reason or other)and then have to find out if a number is even or odd


The one way I could Find out was like this :

integer check = valueToCheck / 2;
Integer newValue = check*2 ;
Integer result = valueToCheck - newValue ;
if(result == 0)
//print that it's even
else
//print that it's odd






Friday, February 11, 2011

Check

Tere jaane ka asar kuchh aisa hua mujhpar,
Tujhe dhoondhte dhoondhte maine khud ko pa liya.