Professional Documents
Culture Documents
TED University
In this experiment you are going to implement series functions to calculate armstrong numbers with
different scenarios.
In the given program there are four functions, namely, main, armstrong_number, armstrong_in_range,
and armstrong_recursive. main function is already provided, and it is supposed to remain as it is (you
should not change it). You are required to implement armstrong_number, armstrong_in_range and
armstrong_recursive functions.
A number to be checked whether it is armstrong number or not. It is given as an input and the function
returns 1 if it is armstrong and 0 if not.
A range to be checked is entered as an input to calculate all armstrong numbers in the given range. The
function prints all the armstrong numbers in the given range.
Computer Engineering Department
TED University
The ranges are calculated and printed through the called function.
It performs same operation as in Task 1, however in a recursive manner. A number to be checked whether
it is armstrong or not is given as an input and the function returns the summation of the digits. If the
returned value is equal to the given input value then it is an armstrong number.
The implementations without recursion will not be graded for this part.