Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

Determine if a number is a power of 2 at O(1).

Answer Posted / hary

int Isnopowerof2(int n)
{
if (n & n-1)
return 0;
return 1;
}

Is This Answer Correct ?    15 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is pointers in c?

1124


How can you allocate arrays or structures bigger than 64K?

1151


What is size of union in c?

1028


What is the total generic pointer type?

1164


Why should I use standard library functions instead of writing my own?

1274


Are pointers really faster than arrays?

1037


What are the rules for identifiers in c?

1073


What is the purpose of void in c?

1071


What is the difference between break and continue?

1543


what is the c source code for the below output? 10 10 10 10 10 10 10 10 10 10 9 9 7 6 6 6 6 6 6 9 7 5 9 7 3 2 2 5 9 7 3 1 5 9 7 3 5 9 7 4 4 4 4 5 9 7 8 8 8 8 8 8 8 8 9

1835


Tell us the use of fflush() function in c language?

1157


C program execution always begins with a) #include b) comment (/*-------*/) c) main() d) declaration instructions

1065


what is ur strangth & weekness

2441


Compare array data type to pointer data type

1043


Why is c not oop?

983