Given an unsigned integer, find if the number is power of 2?
Answer Posted / veerendra jonnalagadda
main()
{
int i;
printf("Enter Number :");
scanf("%d",&i);
if(i&(i-1))
printf("Not atwo power");
else
printf("Two 's Power");
}
| Is This Answer Correct ? | 3 Yes | 0 No |
Post New Answer View All Answers
What is queue in c?
What is the Purpose of 'extern' keyword in a function declaration?
What is graph in c?
Can you please explain the difference between strcpy() and memcpy() function?
What is string concatenation in c?
Explain how do you sort filenames in a directory?
How will you find a duplicate number in a array without negating the nos ?
What type of function is main ()?
Can one function call another?
What are the standard predefined macros?
What is bubble sort in c?
Why can arithmetic operations not be performed on void pointers?
Why is it usually a bad idea to use gets()? Suggest a workaround.
What are the header files used in c language?
Explain what is meant by high-order and low-order bytes?