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, 23.06.2019 00:00
Suppose you have 9 coins and one of them is heavier than others. other 8 coins weight equally. you are also given a balance. develop and algorithm to determine the heavy coin using only two measurements with the of the balance. clearly write your algorithm in the form of a pseudocode using the similar notation that we have used in the class to represent sorting algorithms
Answers: 1
question
Computers and Technology, 23.06.2019 01:50
Free points just awnser this. what should i watch on netflix
Answers: 2
question
Computers and Technology, 23.06.2019 22:30
How many points do i need before i can send a chat
Answers: 1
question
Computers and Technology, 24.06.2019 00:20
Describe a data structures that supports the stack push and pop operations and a third operation findmin, which returns the smallest element in the data structure, all in o(1) worst-case time.
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
Questions on the website: 13722363