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 is the difference between struct and typedef struct in c?

1087


What is the right type to use for boolean values in c?

994


How many types of sorting are there in c?

1013


How can I make sure that my program is the only one accessing a file?

1195


What is meant by keywords in c?

1039


Are pointers really faster than arrays?

969


What is the difference between mpi and openmp?

1221


Discuss the function of conditional operator, size of operator and comma operator with examples.

1100


Explain bitwise shift operators?

1174


Why c is called top down?

1096


Write a code to generate a series where the next element is the sum of last k terms.

1173


Explain what does the format %10.2 mean when included in a printf statement?

1294


void main(){ int a; a=1; while(a-->=1) while(a-->=0); printf("%d",a); }

1670


What is the use of extern in c?

1051


Can 'this' pointer by used in the constructor?

1047