Computer Science, asked by Anonymous, 8 months ago

Answer this fast.
give Correct answer. Wrong answer will be reported !!​

Attachments:

Answers

Answered by aditya659915
1

java.util.*

class ArmstrongExample

{

public static void main(String[] args)

{

Scanner in = new Scanner (System.in);

int c=0,a,temp;

System.out.println ("Enter the number')

int n = in.nextInt ();

temp=n;

while(n>0)

{

a=n%10;

n=n/10;

c=c+(a*a*a);

}

if(temp==c)

System.out.println("armstrong number");

else

System.out.println("Not armstrong number");

}

}

Thank you!

Please mark me as Brainliest!

Similar questions