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...

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


Please Help Members By Posting Answers For Below Questions

What are structural members?

1004


Explain what are reserved words?

1101


Is array a primitive data type in c?

1053


What is c system32 taskhostw exe?

1021


A global variable when referred to in another file is declared as this a) local variable b) external variable c) constant d) pointers

1190


Can a variable be both const and volatile?

1128


Why use int main instead of void main?

1116


Why does the call char scanf work?

1201


Why do we use int main?

1095


What is the benefit of using an enum rather than a #define constant?

1232


What are the different types of objects used in c?

1024


What does node * mean?

1200


explain how do you use macro?

1152


what is the difference between 123 and 0123 in c?

1201


how do you execute a c program in unix.

1111