Menu
Question Index
...


Write a program to find whether given number is Narcissistic number. Narcissistic number is a number that is the sum of its own digits each raised to the power of the number of digits equal to number itself.

Input (int) Output (boolean)
153 153 = 1^3 + 5^3 + 3^3
true
145 false
370 true
523 false
6 true

class IsNarcissisticNumber

{    public static void main(String s[])
    {
        int number = 153;
        System.out.println("Is " + number + " a Narcissistic number : " + isNarcissisticNumber(number));

    }


public static boolean isNarcissisticNumber(int number) {
//Write a code here to find given number is Narcissistic number or not.
}
}

Doubts

Problems

Topic: Java for loops vs Java while loops vs Java do while loops Java for loops vs Java while loops vs Java do while loops

Read this topic Read this topic
Take test on this topic

0
Wrong
Score more than 2 points

© meritcampus 2019

All Rights Reserved.

Open In App