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 actual argument?
Tell us something about keyword 'auto'.
How can my program discover the complete pathname to the executable from which it was invoked?
What is the total generic pointer type?
write a program that reads lines(using getline), converts each line to an integer using atoi, and computes the average of all the numbers read. also compute the standard deviation.
What is data structure in c programming?
What are header files and what are its uses in C programming?
What are register variables in c?
Explain bitwise shift operators?
what is the format specifier for printing a pointer value?
What is the difference between formatted&unformatted i/o functions?
Is c procedural or object oriented?
What is the scope of static variable in c?
What are structure types in C?
What are the 32 keywords in c?