CoolInterview.com - World's Largest Collection of Interview Questions
Send Free SMS
 Interview Questions  
 Our Services  


INTERVIEW QUESTIONS LANGUAGES C DETAILS
Question :
Write the equivalent expression for x%8?
Category C Interview Questions
Rating (4.1) By 63 users
Added on 10/22/2004
Views 8042
Rate it!
Answers:

x&7



x-(8 * (x/8))



 Posted by: unknown    

Contact unknown  Contact unknown

int a=0;
int remainder=0;
a=x/8;
remainder=x-(a*8);

will give the same result as of x%8



 Posted by: Rohit Kamthe    

Contact Rohit Kamthe  Contact Rohit Kamthe

int remainder=0;
int i=0;
i=x/8;
remainder=x-(i*8);

this will give you the same output as x%8



 Posted by: Rohit Kamthe    

Contact Rohit Kamthe  Contact Rohit Kamthe

Alternative expression:
x&0x7(x bitwise and with 0x7)



 Posted by: Samy     

Contact Samy   Contact Samy

x % 8 = x & 7



 Posted by: Manash    

Contact Manash  Contact Manash

the equivalent expression for x%8 is x-(x/8)*8



 Posted by: karthik    

Contact karthik  Contact karthik


If you have the better answer, then send it to us. We will display your answer after the approval.
Name :*
Email Id :*
Answer :*
Verification Code Code Image - Please contact webmaster if you have problems seeing this image code Not readable? Load New Code
Process Verification  Enter the above shown code:*
Inform me about updated answers to this question

   
Related Questions
View Answer
Which expression always return true? Which always return false?
View Answer
What is storage class and what are storage variable ?
View Answer
What are the advantages of auto variables?
View Answer
Diffenentiate between an internal static and external static variable?
View Answer
What are advantages and disadvantages of external storage class?
View Answer
Differentiate between a linker and linkage?
View Answer
What are the characteristics of arrays in C?
View Answer
When does the compiler not implicitly generate the address of the first element of an array?
View Answer
What is modular programming?
View Answer
What is a function and built-in function?
View Answer

Please Note: We keep on updating better answers to this site. Subscribe to our newsletter to get notified when better answer is posted.

Notify me when better answer is posted!
Email:

View ALL C Interview Questions

User Options
Sponsored Links


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


Download Yahoo Messenger | Placement Papers| FREE SMS | ASP .Net Tutorial | Web Hosting | Free SMS | Dedicated Servers | Joke of the Day

0.61