Function to find the given number is a power of 2 or not?
Answer Posted / abhinay
main()
{
int n,m;
do
{
m=n%2;
n=m;
}
while(n>1);
if(m==1)
{
Printf("Number is not a power of 2");
}
else
{
printf("Number is a power of 2");
}
}
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
can any one please explain, how can i access hard disk(physical address)? it is possible by the use of far,near or huge pointer? if yes then please explain......
In C language, the variables NAME, name, and Name are all the same. TRUE or FALSE?
What is call by reference in functions?
Can you think of a logic behind the game minesweeper.
Is there any data type in c with variable size?
Is a pointer a kind of array?
What does node * mean?
if p is a string contained in a string?
What is Dynamic memory allocation in C? Name the dynamic allocation functions.
What do you mean by dynamic memory allocation in c?
How can I read and write comma-delimited text?
Can you subtract pointers from each other? Why would you?
What are disadvantages of C language.
diff between exptected result and requirement?
The file stdio.h, what does it contain?