We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c825bb9 commit 074c75fCopy full SHA for 074c75f
1 file changed
Atharva_35.py
@@ -0,0 +1,24 @@
1
+# Simple program in python for checking for armstrong number
2
+# Python program to check if the number is an Armstrong number or not
3
+
4
+y='y'
5
6
+while y == 'y': # while loop
7
+# take input from the user
8
+ x = int(input("Enter a number: "))
9
10
+ sum = 0
11
12
+ temp = x
13
+ while temp > 0: #loop for checking armstrong number
14
+ digit = temp % 10
15
+ sum += digit ** 3
16
+ temp //= 10
17
18
+ if x == sum:
19
+ print(x,"is an Armstrong number")
20
+ else:
21
+ print(x,"is not an Armstrong number")
22
23
+ y=input("WNamt to continue?(y/n)") #Condition for multiple run
24
0 commit comments