

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


import java.util.; class A { int a,rr=0,r,aa; void arm(int x) { a=x; aa=x; while (a!=0) { r = a % 10; rr=rr+ (rr*r); a=a/10; } if(rr==a) System.out.println("Armstrong number"); else System.out.println(r + "not Armstrong number"); } } public class B { public static void main(String arg[]) { int x; Scanner sA = new Scanner(System.in); x=sA.nextInt();
A t1 = new A(); t1.arm(x); } }