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 ? | 5 Yes | 0 No |
Post New Answer View All Answers
What is a pointer in c?
Which is the best website to learn c programming?
What is the correct code to have following output in c using nested for loop?
What is a structure and why it is used?
What is assert and when would I use it?
What is #include stdlib h?
Write a function stroverlap that takes (at least) two strings, and concatenates them, but does not duplicate any overlap. You only need to worry about overlaps between the end of the first string and the beginning of the second string. Examples: batman, manonthemoon = batmanonthemoon batmmamaman, mamamanonthemoon = batmmamamanonthemoon bat, man = batman batman, batman = batman batman, menonthemoon = batmanmenonthemoon
What is the difference between local variable and global variable in c?
What is the difference between char array and char pointer?
Explain indirection?
Explain what is wrong with this program statement? Void = 10;
What is the role of && operator in a program code?
What are the advantages of union?
Give differences between - new and malloc() , delete and free() ?
What are the types of i/o functions?