➽ Program:-

import java.util.*;

import java.io.*;

class Main

{

    public static void main(String args[])

    {

       int num, sum = 0, remainder, temp;

       Scanner sc = new Scanner(System.in);

      

       System.out.print("Enter a Number: ");

       num = sc.nextInt();

       temp = num;

 

       while(temp != 0)

       {

          remainder = temp % 10;

          sum += Math.pow(remainder, 3);

          temp = temp / 10;

       }

 

       if(sum == num)

          System.out.print(num + " is an Armstrong No");

       else

          System.out.print(num + " is not an Armstrong No");

    }

}

➽ Output:-

Enter a Number: 371
371 is an Armstrong No

Enter a Number: 1600
1600 is not an Armstrong No