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
Should I learn c before c++?
Define Spanning-Tree Protocol (STP)
A program is required to print your biographic information including: Names, gender, student Number, Cell Number, line of study and your residential address.
What are the types of unary operators?
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
Why & is used in scanf in c?
Why is c called c not d or e?
What is the difference between c and python?
Difference between exit() and _exit() function?
Write a C program to accept a matrix of any size. Find the frequency count of each element in the matrix and positions in which they appear in the matrix
write a program to find the given number is prime or not
What is the size of enum in bytes?
Why header files are used?
Explain what is the general form of a c program?
On most computers additional memory that is accessed through an adapter of feature card along with a device driver program. a) user memory b) conventional memory c) expandedmemory d) area