Function to find the given number is a power of 2 or not?
Answer Posted / abhishek sharma
unsigned int is_power_of_2(unsigned int x)
{
return (x != 0) && ((x & (x - 1)) == 0);
}
| Is This Answer Correct ? | 23 Yes | 3 No |
Post New Answer View All Answers
How are strings stored in c?
what is associativity explain what is the precidence for * and & , * and ++ how the folloing declaration work 1) *&p; 2) *p++;
what is reason of your company position's in india no. 1.
What does 1f stand for?
FORMATTED INPUT/OUTPUT functions are a) scanf() and printf() b) gets() and puts() c) getchar() and putchar() d) all the above
What is return type in c?
What does node * mean?
difference between native and cross compilers
What is operator promotion?
What is pragma in c?
What do you understand by friend-functions? How are they used?
What is the value of uninitialized variable in c?
write a program to reverse a every alternetive words in a string in a place. EX: Input is "this is the line of text" Output should be "shit is eht line fo text" Please any one tell me code for that.
Is int a keyword in c?
Is there a way to switch on strings?