The document describes an experiment to write a Python program that determines if a given number is an Armstrong number or not. It provides the aim, objective, and algorithm steps to read a number, initialize a sum, calculate the sum of the cube of each digit, and check if it equals the original number, then print the result. The program takes in a number as input and outputs whether it is or isn't an Armstrong number, demonstrating how to implement the basics of Python programming to solve this problem.
The document describes an experiment to write a Python program that determines if a given number is an Armstrong number or not. It provides the aim, objective, and algorithm steps to read a number, initialize a sum, calculate the sum of the cube of each digit, and check if it equals the original number, then print the result. The program takes in a number as input and outputs whether it is or isn't an Armstrong number, demonstrating how to implement the basics of Python programming to solve this problem.
The document describes an experiment to write a Python program that determines if a given number is an Armstrong number or not. It provides the aim, objective, and algorithm steps to read a number, initialize a sum, calculate the sum of the cube of each digit, and check if it equals the original number, then print the result. The program takes in a number as input and outputs whether it is or isn't an Armstrong number, demonstrating how to implement the basics of Python programming to solve this problem.
Aim: Write a program to determine whether a given number is Armstrong or not.
Objective: ● To study the basics of python programming. Outcome: Students will be able to implement the basics of python programming. Algorithm\Implementation Steps\Installation Steps: 1. Read num value 2. Initialize Sum=0 3. Temp=num 4. If num>0 Else goto step 6 5. While (temp>0): 5.1Rem=temp%10 5.2temp=temp//10 6. If num==sum 6.1 : Print(num,”is an armstrong number”) 7. Else 7.1 : Print(num,”is not an armstrong number”) 8. End of the program.
Source Code: Input and Output:
Conclusion: Thus, the Python program to find the given number is Armstrong or not is executed successfully and the output is verified.