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 15:00
Hyperactive media sales has 10 windows 7 laptop computers used by sales-people in the organization. each laptop computer has several customized applications that are used during the sales process as well as customer relationship management software. all of the applications on the laptops are difficult to configure and have large data files. if all of the laptops have current hardware, what is the easiest way to install windows 10 on them?
Answers: 1
question
Computers and Technology, 22.06.2019 22:20
Pp 4.1 design and implement a class called sphere that contains instance data that represents the sphere’s diameter. define the sphere constructor to accept and initialize the diameter and include getter and setter methods for the diameter. include methods that calculate and return the volume and surface area of the sphere (see pp 3.5 for the formulas). include a tostring method that returns a one-line description of the sphere. create a driver class called multisphere, whose main method instantiates and updates several sphere objects.
Answers: 1
question
Computers and Technology, 22.06.2019 22:30
Alex’s family members live in different parts of the world. they would like to discuss the wedding plans of one of their distant relatives. however, alex wants all the family members to talk to each other simultaneously so that they can make decisions quickly. which mode of internet communication should they use? a. blog b. email c. wiki d. message board e. instant messaging
Answers: 2
question
Computers and Technology, 23.06.2019 11:00
How should you specify box sizes on a web page if you want the boxes to vary according to the font size of the text they contain? a. in pixels b. in inches c. as percentages d. in em units
Answers: 2
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, 10.09.2020 09:01
question
Mathematics, 10.09.2020 09:01
question
Mathematics, 10.09.2020 09:01
question
Mathematics, 10.09.2020 09:01
question
Mathematics, 10.09.2020 09:01
question
Mathematics, 10.09.2020 09:01
question
Mathematics, 10.09.2020 09:01
question
Mathematics, 10.09.2020 09:01
question
Mathematics, 10.09.2020 09:01
question
Mathematics, 10.09.2020 09:01
question
Mathematics, 10.09.2020 09:01
question
Mathematics, 10.09.2020 09:01
question
Mathematics, 10.09.2020 09:01
question
Mathematics, 10.09.2020 09:01
question
Geography, 10.09.2020 09:01
question
Mathematics, 10.09.2020 09:01
question
Mathematics, 10.09.2020 09:01
question
Mathematics, 10.09.2020 09:01
question
Mathematics, 10.09.2020 09:01
question
Mathematics, 10.09.2020 09:01
Questions on the website: 13722360