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 is a void pointer used?
How can you tell whether a program was compiled using c versus c++?
How can I send mail from within a c program?
What is a pointer value and address in c?
Explain can you assign a different address to an array tag?
1) There is a singing competition for children going to be conducted at a local club. Parents have been asked to arrive at least an hour before and register their children’s names with the Program Manager. Whenever a participant registers, the Program Manager has to position the name of the person in a list in alphabet order. Write a program to help the Program Manager do this by placing the name in the right place each time the Program Manger enters a name. The Logic should be written in Data Structures?
Can one function call another?
What is the size of a union variable?
What are categories used for in c?
How can you call a function, given its name as a string?
a direct address that identifies a location by means of its displacement from a base address or segment a) absolute address b) relative address c) relative mode d) absolute mode
How can I ensure that integer arithmetic doesnt overflow?
What does it mean when the linker says that _end is undefined?
develop algorithms to add polynomials (i) in one variable
What is a keyword?