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 ? | 3 Yes | 0 No |
Post New Answer View All Answers
what type of questions arrive in interview over c programming?
program to find out date after adding 31 days to a date in the month of febraury also consider the leap year
What is the size of a union variable?
write a C program: To search a file any word which starts with ?a?. If the word following this ?a? starts with a vowel.Then replace this ?a? with ?a? with ?an?. redirect with the output onto an output file.The source file and destination file are specified by the user int the command line.
What’s the special use of UNIONS?
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
Explain the difference between malloc() and calloc() in c?
Explain about the functions strcat() and strcmp()?
What is the Purpose of 'extern' keyword in a function declaration?
write a program to print data of 5 five students with structures?
write a program to find out prime number using sieve case?
how to write optimum code to divide a 50 digit number with a 25 digit number??
What are register variables? What are the advantage of using register variables?
Where local variables are stored in c?
What is the difference between typedef struct and struct?