Computer Science, asked by shinchan139, 3 months ago

the program in Java print all 3 digit Armstrong numbers​

Answers

Answered by Anonymous
5

(refer to the attachment for the output)

To Print:-

All 3 digit Armstrong number in Java.

Solution:-

class armstrong

{

public static void main(String Args[])

{

int i, n, d, s = 0;

for( i = 100; i < = 999; i + +)

{

n=i;

while (n>0)

{

d = n % 10;

s = s + (d*d*d);

n = n / 10;

}

if ( s = = i)

}

System. out.print("Armstrong numbers between the given interval are:"+i+" ");

}

}

Explore MorE:-

Java Programming is Object Oriented Programming Language.

An Armstrong number is a number which equals to the sum of the cubes of its individual digits. For example, 153 is an Armstrong number as − 153 = (1)3 + (5)3 + (3)3 153 1 + 125 + 27 154 153.

Attachments:
Similar questions