How to find whether a given integer is a power of 3 or not?

Posted by Rohit Kumar | Updated on

Want to find whether a given integer is a power of 3 or not in c++ programming language. Any integer number other than power of 3 which divides highest power of 3 value that integer can hold 3^19 = 1162261467 will give reminder non-zero.

Program Output


If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.

Related Questions & Answers