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
When a c file is executed there are many files that are automatically opened what are they files?
FORMATTED INPUT/OUTPUT functions are a) scanf() and printf() b) gets() and puts() c) getchar() and putchar() d) all the above
How can I find out the size of a file, prior to reading it in?
Ow can I insert or delete a line (or record) in the middle of a file?
In a header file whether functions are declared or defined?
what does static variable mean?
Explain how to reverse singly link list.
What is difference between static and global variable in c?
Is c++ based on c?
What is the difference between volatile and const volatile?
How do we make a global variable accessible across files? Explain the extern keyword?
what is recursion in C
What is bash c?
An arrangement of information in memory in such a way that it can be easily accessed and processed by a programming language a) string b) data structure c) pointers d) array
Why do we use return in c?