Gadgets 4 Students Online Courses
Free Tutorials  Go to Your University  Placement Preparation 
0 like 0 dislike
in JECRC University B.Tech(CSE-V Sem) Java Programming Lab by Goeduhub's Expert (5.8k points)
Java program to print the Armstrong numbers

Where can I do online courses From Word's Top Instructors?

UDEMY::  Attend All Udemy Courses in Just INR 450[Coupon]
Coursera:: Join For FREE

1 Answer

0 like 0 dislike
by Goeduhub's Expert (5.8k points)
edited by
Best answer

Program Code

import java.util.*;

public class Armstrong


   public static void main(String[] args)


   Scanner sc=new Scanner(;

   System.out.print("Enter any number: ");

   int num=sc.nextInt();

   int sum=0,dig=0,rem,num1=num;

   int orgNum=num;

   while(num1!=0) //counting no of digits in number





   int flag=dig;

   for(int i=0;i<flag;i++)







       System.out.println(orgNum+" is Armstrong number!");


       System.out.println(orgNum+ " is not a Armstrong number!");




Enter any number: 407

407 is Armstrong number!

For more JU V Sem Java Lab Experiments Click here

Code your future with Programming skills. Courses starting at ₹ 455 only!

3.3k questions

7.1k answers


4.5k users

Related questions

 Important Lists:

Important Lists, Exams & Cutoffs Exams after Graduation PSUs


About Us | Contact Us || Terms & Conditions | Privacy Policy || Youtube Channel || Telegram Channel © Social::   |  | 


Free Online Directory