How to print (2^ n) if there are n char in a string

Can you please be descriptive about your question.
What is your program exactly doing?
Correct me if I have interpreted it wrong.

You want to first calculate the length of the string i.e. n
Then, you want to print 2 raise to power n i.e. 2^n.