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
hai iam working in sap sd module for one year and working in lumax ind ltd in desp department but my problem is i have done m.b.a in hr/marketing and working sap sd there is any combination it. can you give right solution of my problem. and what can i do?
How many types of operators are there in c?
What is c++ used for today?
Explain heap and queue.
What is the difference between array and pointer?
Tell us two differences between new () and malloc ()?
write a program that reads lines(using getline), converts each line to an integer using atoi, and computes the average of all the numbers read. also compute the standard deviation.
find the output? void r(int a[],int c, int n) { if(c>n) { a[c]=a[c]+c; r(a,++c,n); r(a,++c,n); } } int main() { int i,a[5]={0}; r(a,0,5); for(i=0;i<5;i++) printf("\n %d",a[i]); getch(); }
What is the purpose of clrscr () printf () and getch ()?
How to write a multi-statement macro?
List at least 10 sorting methods indicating their average case complexity, worst case complexity and best case complexity.
What is wrong with this declaration?
What is a rvalue?
write a program to display all prime numbers
Why is c called c?