Function to find the given number is a power of 2 or not?
Answer Posted / ms
int ispow2(int number)
{
if(n<o) {
return 0;
}
else {
return !(number&(number-1));
}
| Is This Answer Correct ? | 76 Yes | 13 No |
Post New Answer View All Answers
What is the return type of sizeof?
How macro execution is faster than function ?
in any language the sound structure of that language depends on its a) character set, input/output function, its control structures b) character set, library functions, input/output functions its control structures c) character set, library functions, control sturctures d) character set, operators, its control structures
How are pointers declared in c?
What language is lisp written in?
Once I have used freopen, how can I get the original stdout (or stdin) back?
How can I do peek and poke in c?
What is difference between function overloading and operator overloading?
Why & is used in scanf in c?
What are the different types of objects used in c?
Calculate the weighted average of a list of n numbers using the formula xavg = f1x1+f2x2+ ….+ fnxn where the f’s are fractional weighting factors, i.e., 0<=fi<1, and f1+f2+….+fn = 1
Why do we use int main instead of void main in c?
How many types of sorting are there in c?
how to write a c program to print list of fruits in alpabetical order?
When should you not use a type cast?