by Dinesh Thakur Category: Control Structures

If sum of factorial of each digit of the number is same as the actual number then that number is called as strong number.

Algorithm for Strong Number:

Here the method has one formal argument b and it returns an integer value to its caller.

step 1: Set fact= 1

step 2: Read b

step 3: Set c=b

step 4: Repeat through step-6 until (c > 0)

step 5: fact=fact*c

step 6: c=c-1

step 7: return fact

step 8: Exit

Here is the Java Example for Strong Number:

import java.util.Scanner;

public class StrongNumber
               public static void main(String args[])
                 StrongNumber ss=new StrongNumber();
                 int a,b,r,s=0;
                 Scanner sl=new Scanner(;
                 System.out.println("Enter A Number");
                 b=sl. nextInt() ;
                     System.out.println(a+" is a strong number");
                     System.out.println(a+" is not a strong number");
                       int fact(int i)
                                 int f,j;
                                for(j=i ;j>0;j--)
                                     return f;

Strong Number Program in Java Example

About Dinesh Thakur

Dinesh ThakurDinesh Thakur holds an B.C.A, MCSE, MCDBA, CCNA, CCNP, A+, SCJP certifications. Dinesh authors the hugely popular blog. Where he writes how-to guides around Computer fundamental , computer software, Computer programming, and web apps. For any type of query or something that you think is missing, please feel free to Contact us.

Related Articles