# Project Euler | Problem 16 | Power digit sum

##
__Problem Description__:

2^15= 32768 and the sum of its digits is 3 + 2 + 7 + 6 + 8 = 26.

##
__Concept:__

**BigInteger**class present in

**java.math.***package.

##
__Java Program__:

##
__Output:__

Figure2 |

##
__Similar Problems:__

##
__References:__

**https://projecteuler.net/problem=16**

**https://docs.oracle.com/javase/7/docs/api/java/math/BigInteger.html**

Thank you friends, I hope you have clearly understood the solution of this problem. If you have any doubt, suggestion or query please feel free to comment below. You can also discuss this solution in our forum.

Project Euler | Problem 16 | Power digit sum
Reviewed by Rohit Agarwal
on
10/15/2017
Rating:

why did you use -48

ReplyDeleteBecause ascii value of 0-9 digit is 48-57 and on subtracting two ascii values, we will get integer.

ReplyDelete