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 do you mean by scope of a variable in c?
Explain what are linked list?
What are terms in math?
The file stdio.h, what does it contain?
What are volatile variables in c?
Write a program to reverse a linked list in c.
How many main () function we can have in a project?
How can I get back to the interactive keyboard if stdin is redirected?
How do I get a null pointer in my programs?
write a program that declares an array of 30 elements named "income" in the main functions. then cal and pass the array to a programmer-defined function named "getIncome" within the "getIncome" function, ask the user for annual income of 30 employees. then calculate and print total income on the screen using the following function: "void getIncome ( ai []);
Give a one-line C expression to test whether a number is a power of 2. [No loops allowed - it's a simple test.]
Sir i need notes for structure,functions,pointers in c language can you help me please
What is line in c preprocessor?
pierrot's divisor program using c or c++ code
What is the process to create increment and decrement stamen in c?