Did you search the standard C++ library? You would have found the reference for pow. This link has an example for C, but for C++ you include "cmath" instead of "math.h", and the rest should be useful enough to create your C++ version of it. If you have problems compiling, explicitly link to the library. In G++, you'd pass another argument to the compiler, such as "-lm", for Link math.

Similarly for your clock program you should have looked up the reference. This link, again, contains an (C) example. Try to understand it and modify as you require to make a C++ program that solves your given problem.