7- Write a program to input number of 3 digits and check whether it is Armstrong Number or Not. Hint: to check Armstrong number, we have to calculate sum of each digit's cube and then compare number is equal to Sum or not. If Number equal to Sum of digit's cube then Number will be an Armstrong Number otherwise not. Examplel: 153 is an Armstrong number: here 153 = (1*1*1) + (5*5*5) + (3*3*3). Example2: 371 is an Armstrong number: here 371 (3 3*3) + (7*7*7) + (1*1*1). Example2: 322 is not Armstrong number: here 322 = (3*3*3) + (2*2*2) + (2*2*2).

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter5: Repetition Statements
Section5.7: Do While Loops
Problem 3E: (Misc. application) a. Write a program to reverse the digits of a positive integer number. For...
icon
Related questions
Question
7- Write a program to input number of 3 digits and check whether it is
Armstrong Number or Not.
Hint: to check Armstrong number, we have to calculate sum of each digit's
cube and then compare number is equal to Sum or not. If Number equal to
Sum of digit's cube then Number will be an Armstrong Number otherwise not.
Examplel: 153 is an Armstrong number: here 153 = (1*1*1) + (5*5*5) + (3*3*3).
Example2: 371 is an Armstrong number: here 371 (3*3*3) + (7*7*7) + (1*1*1).
Example2: 322 is not Armstrong number: here 322 = (3*3*3) + (2*2*2) + (2*2*2).
Transcribed Image Text:7- Write a program to input number of 3 digits and check whether it is Armstrong Number or Not. Hint: to check Armstrong number, we have to calculate sum of each digit's cube and then compare number is equal to Sum or not. If Number equal to Sum of digit's cube then Number will be an Armstrong Number otherwise not. Examplel: 153 is an Armstrong number: here 153 = (1*1*1) + (5*5*5) + (3*3*3). Example2: 371 is an Armstrong number: here 371 (3*3*3) + (7*7*7) + (1*1*1). Example2: 322 is not Armstrong number: here 322 = (3*3*3) + (2*2*2) + (2*2*2).
Expert Solution
steps

Step by step

Solved in 4 steps with 3 images

Blurred answer
Knowledge Booster
Mathematical functions
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning