answersLogoWhite

0

7

User Avatar

Wiki User

14y ago

What else can I help you with?

Continue Learning about Math & Arithmetic

Give a one-line C expression to test whether a number is a power of 2?

The one line expression is: ((0 != n) && !(n & n-1)) example: int main () { for (int n = 0; n <= 1000001; ++n) { if ((0 != n) && !(n & n-1)) cout << n << " is a power of 2" << endl; } return 0; } will produce: 1 is a power of 2 2 is a power of 2 4 is a power of 2 8 is a power of 2 16 is a power of 2 32 is a power of 2 64 is a power of 2 128 is a power of 2 256 is a power of 2 512 is a power of 2 1024 is a power of 2 2048 is a power of 2 4096 is a power of 2 8192 is a power of 2 16384 is a power of 2 32768 is a power of 2 65536 is a power of 2 131072 is a power of 2 262144 is a power of 2 524288 is a power of 2


What is 2 to the 2 power negative 3 to the 2 power plus 4 to the 2 power?

2 to the 2 power = 4 -3 to the 2 power = 9 4 to the 2 power = 16 You don't indicate what to do to the 4, but 9 + 16 = 25


What is 2 to the power of -2?

2 to the power of -2 is 0.25


What the value of 2 to the power of 1?

Just 2 2 to power 3 is 2x2x2=8 2 to power 2 is 2x2=4 2 to power 1 is 2


How is 2 to the power of 0 equal to 1?

Examples may give you an amazing idea of how to do it : 2 to the power of 0 is = 1 2 to the power of 1 is = 2 2 to the power of 2 is = 4 2 to the power of 3 is = 8 2 to the power of 4 is = 16 why is the answer like that ? well 2 to the power of something is the same as 2*?, for examples : 2 to the power of 4 is the same as : 2*2*2*2=16 2 to the power of 5 is the same as : 2*2*2*2*2=32 Do you understand now ? XD

Related Questions

What are the release dates for Enviropals - 2009 Water Power 2-2?

Enviropals - 2009 Water Power 2-2 was released on: USA: 27 July 2010


What are the release dates for The Colony - 2009 Power Struggle 1-2?

The Colony - 2009 Power Struggle 1-2 was released on: USA: 28 July 2009


What are the release dates for Power Singles - 2009?

Power Singles - 2009 was released on: USA: 2 August 2009 (48 Hour Film Project)


What are the release dates for Ghost Hunters Academy - 2009 Crazy for Power 2-2?

Ghost Hunters Academy - 2009 Crazy for Power 2-2 was released on: USA: 9 June 2010


What are the release dates for The Hour of Power - 1970 2009-05-02?

The Hour of Power - 1970 2009-05-02 was released on: USA: 2 May 2009


What is the remainder when 2 to the power of 2009 is divided by 17?

3


What are the release dates for Important Things with Demetri Martin - 2009 Power 1-2?

Important Things with Demetri Martin - 2009 Power 1-2 was released on: USA: 18 February 2009 Australia: 22 February 2010


What are the release dates for Casper's Scare School - 2009 Power Outage Part 1 A Powerful Foe Power Outage Part 2 Razznik's Revenge 1-19?

Casper's Scare School - 2009 Power Outage Part 1 A Powerful Foe Power Outage Part 2 Razznik's Revenge 1-19 was released on: USA: 2 November 2009


What are the release dates for Anacostia - 2009 The Power of Goodbye 3-8?

Anacostia - 2009 The Power of Goodbye 3-8 was released on: USA: 2 June 2012


What are the release dates for Power Rangers R-P-M- - 2009 Danger and Destiny Part 2 1-32?

Power Rangers R-P-M- - 2009 Danger and Destiny Part 2 1-32 was released on: USA: 26 December 2009


What are the release dates for Power Rangers R-P-M- - 2009 Ranger Yellow Part 2 1-9?

Power Rangers R-P-M- - 2009 Ranger Yellow Part 2 1-9 was released on: USA: 25 April 2009


What are the ratings and certificates for Power Rangers R-P-M- - 2009 Fade to Black 1-2?

Power Rangers R-P-M- - 2009 Fade to Black 1-2 is rated/received certificates of: USA:TV-Y7