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
What are structural members?
Explain what are reserved words?
Is array a primitive data type in c?
What is c system32 taskhostw exe?
A global variable when referred to in another file is declared as this a) local variable b) external variable c) constant d) pointers
Can a variable be both const and volatile?
Why use int main instead of void main?
Why does the call char scanf work?
Why do we use int main?
What is the benefit of using an enum rather than a #define constant?
What are the different types of objects used in c?
What does node * mean?
explain how do you use macro?
what is the difference between 123 and 0123 in c?
how do you execute a c program in unix.