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 is the use of extern in c?
What is time complexity c?
Which is better pointer or array?
Is null a keyword in c?
Can a pointer be volatile in c?
how to execute a program using if else condition and the output should enter number and the number is odd only...
Why is this loop always executing once?
Explain argument and its types.
Can one function call another?
How do you list files in a directory?
to find the closest pair
Explain continue keyword in c
Write a C program on Centralized OLTP, Decentralized OLTP using locking mechanism, Semaphore using locking mechanism, Shared memory, message queues, channel of communication, sockets and a simple program on Saving bank application program using OLTP in IPC?
Why & is used in scanf in c?
write a c program for swapping two strings using pointer