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

What is the meaning of 2d in c?

1064


What is the symbol indicated the c-preprocessor?

1166


Why do we use c for the speed of light?

1103


What is the difference between exit() and _exit() function in c?

1018


Why is c called a mid-level programming language?

1153


How can I write a function analogous to scanf?

1099


Explain the priority queues?

1032


disply the following menu 1.Disply 2.Copy 3.Append; as per the menu do the file operations 4.Exit

2017


How do I determine whether a character is numeric, alphabetic, and so on?

1070


What is a null pointer in c?

1124


what is bit rate & baud rate? plz give wave forms

1914


Explain logical errors? Compare with syntax errors.

1011


What does node * mean?

1143


Is it better to use a pointer to navigate an array of values, or is it better to use a subscripted array name?

1034


If fflush wont work, what can I use to flush input?

1051