Check to see if num is below 1, if it is then you know that your number is not a power of 3. Also, by my judgement your program will consider 82 to be a power of 3, which as you well know is 1 more...