subject

So far we have worked on obtaining individual digits from 4 digits of 5 digit numbers. The added them to find the sum of digits. However, now we know about the loop and we can remove the limit of having a specific number of digits. Write a program to print out all Armstrong numbers between 1 and n where n will be an user input. If the sum of cubes of each digit of the number is equal to the number itself, then the number is called an Armstrong number. For example, 153 = (1 * 1* 1)+ ( 5 * 5* 5 ) + ( 3*3*3) In order to solve this problem we will implement the following function: sumDigitCube(): write a function sumDigitCube() that takes a positive integer as a parameter and returns the sum of cube of each digit of the number. Then in the main function, take an integer n as input and generate each number from 1 to n and call the sumDigitCube() function. Based on the returned result, compares it with the value of the generated number and take a decision and print the number if it is Armstrong number

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 17:00
Aisha has finished working on a word processing document that contains 15 pages. she has added some special elements in the first three pages, page 9 and 10, and page 15 from the document. she wants to print only these pages to see how they look. which option is the correct way to represent (in the print dialog box) the pages that aisha wants to print
Answers: 3
question
Computers and Technology, 22.06.2019 18:00
Determine whether the following careers would require training or college.
Answers: 1
question
Computers and Technology, 23.06.2019 16:00
What is the biggest difference between section breaks and regular page breaks? section breaks are more difficult to add than page breaks. section breaks make it easier for you to view the document as an outline. section breaks allow you to have areas of the document with different formatting. section breaks are smaller than regular page breaks.
Answers: 2
question
Computers and Technology, 23.06.2019 19:50
Which feature is selected to practice and save the timing of a presentation
Answers: 1
You know the right answer?
So far we have worked on obtaining individual digits from 4 digits of 5 digit numbers. The added the...
Questions
question
Mathematics, 15.10.2021 01:00
question
Physics, 15.10.2021 01:00