Powers Of 3

March 1, 2016

The powers of 3 are 30 = 1, 31 = 3, 32 = 9, 33 = 27, and so on.

Your task is to write a program that determines if a number is a power of 3; you must give more than one solution. When you are finished, you are welcome to read or run a suggested solution, or to post your own solution or discuss the exercise in the comments below.

Pages: 1 2