Question: Programming in C A k-digit number is called narcissistic if the sum of the kth power of its digits equals the number. Examples of such

Programming in C

A k-digit number is called narcissistic if the sum of the kth power of its digits equals the number. Examples of such numbers are: 153 = 13 + 53 + 33 1634 = 14 + 64 + 34 + 44 54748 = 55 + 45 + 75 + 45 + 85 Write a program that lists all narcissistic numbers that are 9 digits or less in length. Recall that pow(x,y), defined in math.h returns the value of x raised to the power y. (Hint. It would help to define and use a function that, given a number and an array, extracts the digits of the number into the array and also returns the length of the number).

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!