Computer Science, asked by lakshmihari954, 1 day ago

Write a program in java to enter a number and check whetger the sum of the powers of the digits is equal to the number itself .


example: 1234
=1⁴+2⁴+3⁴+4⁴
=1234
thus program must be dine using a function which has a return type as integer​

Answers

Answered by 0mouryaritesh
0

Explanation:

Input: number = 5, power = 4

Output: 13

Explanation:

Raising 5 to the power 4 we get 625.

Now adding all the digits = 6 + 2 + 5

Input: number = 9, power = 5

Output: 27

Explanation:

Raising 9 to the power 5 we get 59049.

Now adding all the digits = 5 + 9 + 0 + 4 + 9

Similar questions