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


Please Help Members By Posting Answers For Below Questions

Explain what is a program flowchart and explain how does it help in writing a program?

1103


What are conditional operators in C?

1107


You are to write your own versions of strcpy() and strlen (). Call them mystrcpy() and mystrlen(). Write them first as code within main(), not as functions, then, convert them to functions. You will pass two arrays to the function in the case of mystrcpy(), the source and target array.

2341


What is the purpose of the statement: strcat (S2, S1)?

1172


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

1208


Write a program for finding factorial of a number.

1092


What is calloc() function?

1113


What is static memory allocation? Explain

1107


Find duplicates in a file containing 6 digit number (like uid) in O (n) time.

3250


What does a pointer variable always consist of?

1107


Can a pointer be static?

1091


Write a program to print all permutations of a given string.

1203


What is property type c?

1096


Write a C program to accept a matrix of any size. Find the frequency count of each element in the matrix and positions in which they appear in the matrix

2011


The % symbol has a special use in a printf statement. Explain how would you place this character as part of the output on the screen?

1216