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

Function to find the given number is a power of 2 or not?

Answer Posted / sudhesh

#include<stdio.h>
main()
{
int num,result;
printf("\nEnter the number:=");
scanf("%d",&num);
if (result=num&(num-1))
printf("No\n");
else
printf("Yes\n");
}

Is This Answer Correct ?    1 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How can I write data files which can be read on other machines with different word size, byte order, or floating point formats?

1085


What is c value paradox explain?

1165


What is a MAC Address?

1123


What are the string functions? List some string functions available in c.

1043


How can you determine the size of an allocated portion of memory?

1361


Write a program to swap two numbers without using a temporary variable?

1181


What is a structure in c language. how to initialise a structure in c?

1122


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

1095


write a programming in c to find the sum of all elements in an array through function.

2222


Why dont c comments nest?

1112


Stimulate calculator using Switch-case-default statement for two numbers

3041


Which is more efficient, a switch statement or an if else chain?

1081


What is the difference between union and structure in c?

1280


write a program to concatenation the string using switch case?

2156


What is the explanation for modular programming?

1276