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
Is using exit() the same as using return?
The file stdio.h, what does it contain?
Difference between MAC vs. IP Addressing
What is volatile c?
What are run-time errors?
What is the method to save data in stack data structure type?
What’s the special use of UNIONS?
What is the difference between abs() and fabs() functions?
What is difference between stdio h and conio h?
What is the significance of scope resolution operator?
Write a Program to accept different goods with the number, price and date of purchase and display them
swap 2 numbers without using third variable?
What is the use of function in c?
Write a program to print factorial of given number using recursion?
Why is structure padding done in c?