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 would the following code segment printint k = 8;docout << "k = " << k << " ";while k++ < 5; a) 13 b) 5 c) 8 d) pointers
What are the parts of c program?
Why use int main instead of void main?
Describe how arrays can be passed to a user defined function
What is memcpy() function?
Differentiate between a for loop and a while loop? What are it uses?
What are different storage class specifiers in c?
Where are local variables stored in c?
Can we use visual studio for c?
How can I pad a string to a known length?
write a program which the o/p should b in such a way that s triangle if I/p is 3,a Square/rectangle if I/P=4,a pentagon if I/P=5 and so on...forget about the I/P which is less than 3
What is calloc in c?
Was 2000 a leap year?
Are there any problems with performing mathematical operations on different variable types?
What is the use of typedef in c?