x&7
x-(8 * (x/8))
int a=0;int remainder=0;a=x/8;remainder=x-(a*8);will give the same result as of x%8
int remainder=0;int i=0;i=x/8;remainder=x-(i*8);this will give you the same output as x%8
Alternative expression:x&0x7(x bitwise and with 0x7)
x % 8 = x & 7
the equivalent expression for x%8 is x-(x/8)*8
Please Note: We keep on updating better answers to this site. Subscribe to our newsletter to get notified when better answer is posted.
Copyright ©2003-2010 CoolInterview.com, All Rights Reserved. Privacy Policy | Terms and Conditions Page URL: http://www.coolinterview.com/interview/981/default.asp?cachecommand=bypass