Skip to content

Commit ff29792

Browse files
authored
Automorphic Number
Python program to check a number is automorphic or not.
1 parent 638a7e3 commit ff29792

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

automorphic.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
print("Enter the number you want to check:")
2+
num=int(input())
3+
square=num*num
4+
flag=0
5+
while(num>0):
6+
if(num%10!=square%10):
7+
print("No, it is not an automorphic number.")
8+
flag=1
9+
break
10+
11+
num=num//10
12+
square=square//10
13+
if(flag==0):
14+
print("Yes, it is an automorphic number.")

0 commit comments

Comments
 (0)