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

Give a oneline C expression to test whether a number is a
power of 2?

Answer Posted / mridul

#include<stdio.h>

main()
{
int a;
scanf("%d",&a);
if (a&1)
printf ("POWER off 2");
printf ("NOT power of 2");
}

Is This Answer Correct ?    3 Yes 45 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How can you relate the function with the structure? Explain with an appropriate example.

3387


Set up procedure for generating a wire frame display of a polyhedron with the hidden edges of the object drawn with dashed lines

3471


Write a routine to implement the polymarker function

4835


A program that will create a movie seat reservation. The program will display the summary seats and its status. The user will be ask what seat no. to be reserved, then it will go back again to the summary to display the updated seat status. If the seat no. is already reserved then it will prompt an error message. And also if the input seat no is out of range then it will also prompt an error message. The program is continuously running. Termination of the program will depends on how the programmer will apply. Sample output: Movie Seats Reservation Summary of Seats: Seat 1: Available Seat 2: Available Seat 3: Available Seat 4: Available Seat 5: Available Enter seat no. (Press 0 to terminate Or the assigned seat capacity) : 1 Movie Seats Reservation Summary of Seats: Seat 1: Reserve Seat 2: Available Seat 3: Available Seat 4: Available Seat 5: Available Enter seat no. (Press 0 to terminate Or the assigned seat capacity) : 6 The Seat no. is out of range! Movie Seats Reservation Summary of Seats: Seat 1: Reserve Seat 2: Available Seat 3: Available Seat 4: Available Seat 5: Available Enter seat no. (Press 0 to terminate Or the assigned seat capacity) : 1 The Seat no. is already reserved! Movie Seats Reservation Summary of Seats: Seat 1: Reserve Seat 2: Available Seat 3: Available Seat 4: Available Seat 5: Available Enter seat no. (Press 0 to terminate Or the assigned seat capacity) : 0 GoodBye... Thank You!!!

2266


How do you verify if the two sentences/phrases input is an anagram using predefined functions in string.h and by using arrays?

2489


Hi, i have a project that the teacher want a pyramid of numbers in C# or java...when we click a button...the pyramid should be generated in a listbox/or JtextArea...and the pyramid should have the folowing form: 1 232 34543 4567654 567898765 67890109876 7890123210987 890123454321098 90123456765432109 0123456789876543210 Plz help with codes...didn't find anything on the net.

3167


Cluster head selection in Wireless Sensor Network using C programming language.

3672


could you please send the program code for multiplying sparse matrix in c????

3524


why nlogn is the lower limit of any sort algorithm?

2784


Develop a routine to reflect an object about an arbitrarily selected plane

3550


Given a spherical surface, write bump-mapping procedure to generate the bumpy surface of an orange

3300


Design an implement of the inputs functions for event mode

3452


What is the match merge ? compare data step match merge with proc sql merge - how many types are there ? data step vs proc sql

2861


write a program for area of circumference of shapes

2505


What is data _null_? ,Explain with code when u need to use it in data step programming ?

3273