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 a function analogous to scanf?

1183


What are the advantages of c language?

1097


How can this be legal c?

1086


Differentiate between the expression “++a” and “a++”?

1249


we called a function and passed something do it we have always passed the "values" of variables to the called function. such functions calles are called a) calls by reference b) calls by value c) calls by zero d) none of the above

1163


a=10;b= 5;c=3;d=3; if(a printf(%d %d %d %d a,b,c,d) else printf("%d %d %d %d a,b,c,d);

1139


What is pragma in c?

1212


can we have joblib in a proc ?

2303


Difference between exit() and _exit() function?

1134


What is a union?

1036


write a program using linked list in which each node consists of following information. Name[30] Branch Rollno Telephone no i) Write the program to add information of students in linked list

2808


Do string constants represent numerical values?

1394


Which is best linux os?

1026


What is a void * in c?

1074


What is difference between structure and union with example?

1059