Question: use java Exercise 1. Write Java program to check if a positive 3 digit number is an Armstrong number or not. For example: 153 the
Exercise 1. Write Java program to check if a positive 3 digit number is an Armstrong number or not. For example: 153 the output is true, 123 output false. An Armstrong number with 3 digits is a number for which the sum of the cubes of its digits is equal to number itself e.g. 371 is an Armstrong number because: 3*3*3 +7*7*7+ 1*1*1-371. If the number is not positive OR is not a 3-digit number, force the user to re-enter the number. Hand-in the program code plus 3 outputs as follows: 1. An Armstrong number 2. Not an Armstrong number 3. An invalid number
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
