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 ? | 5 Yes | 0 No |
Post New Answer View All Answers
Are comments included during the compilation stage and placed in the EXE file as well?
what is associativity explain what is the precidence for * and & , * and ++ how the folloing declaration work 1) *&p; 2) *p++;
ATM machine and railway reservation class/object diagram
Differentiate between the expression “++a” and “a++”?
write a program to convert a expression in polish notation(postfix) to inline(normal) something like make 723+* (2+3) x 7 (not sure) just check out its mainly printing expression in postfix form to infix.
Does c have function or method?
what is the function of pragma directive in c?
Explain how do you generate random numbers in c?
what are the advantages of a macro over a function?
Explain how do you use a pointer to a function?
Explain a file operation in C with an example.
What is difference between %d and %i in c?
Why is structure important for a child?
difference between object file and executable file
How can you pass an array to a function by value?