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

How to compare array with pointer in c?

1112


Hai,I have done with my bachelor of commerce and planing to ms,please suggest me how to convince vo for shifting from commerce to computers. Visa on 8 DEC 2014  Npu university

2044


What is the code for 3 questions and answer check in VisualBasic.Net?

2163


What is the use of #define preprocessor in c?

1081


Explain built-in function?

1146


What is the scope of an external variable in c?

1050


What is pointer in c?

1202


Write a program to check whether a number is prime or not using c?

1060


Give a one-line C expression to test whether a number is a power of 2. [No loops allowed - it's a simple test.]

1090


What are the different types of objects used in c?

1034


What are static variables in c?

1084


Explain what does the function toupper() do?

1079


What is a program?

1272


How can I make it pause before closing the program output window?

1045


how to count no of words,characters,lines in a paragraph.

4432