Given an unsigned integer, find if the number is power of 2?
Answer Posted / asis bera
main()
{
unsigned int n;
printf("enter the number:\n");
scanf("%u",&n);
if(i&(i-1))
printf(" not power of two\n");
else
printf("power of two...\n");
}
Is This Answer Correct ? | 0 Yes | 1 No |
Post New Answer View All Answers
In this problem you are to write a program that will cut some number of prime numbers from the list of prime numbers between 1 and N.Your program will read in a number N; determine the list of prime numbers between 1 and N; and print the C*2 prime numbers from the center of the list if there are an even number of prime numbers or (C*2)-1 prime numbers from the center of the list if there are an odd number of prime numbers in the list.
Q.1 write aprogram to stack using linklist o insert 40 items? Q.2 write a program to implement circular queue with help of linklist?
What is typedef?
Why can arithmetic operations not be performed on void pointers?
What is the difference between the local variable and global variable in c?
What is spaghetti programming?
What is the function of volatile in c language?
Write a program to find factorial of a number using recursive function.
Once I have used freopen, how can I get the original stdout (or stdin) back?
find the sum of two matrices and WAP for it.
How can my program discover the complete pathname to the executable from which it was invoked?
What library is sizeof in c?
Why header files are used?
Difference between macros and inline functions? Can a function be forced as inline?
In c language can we compile a program without main() function?