Skip to content

Commit

Permalink
Automorphic Number
Browse files Browse the repository at this point in the history
Python program to check a number is automorphic or not.
  • Loading branch information
DEBOBANI committed Oct 3, 2022
1 parent 638a7e3 commit ff29792
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions automorphic.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
print("Enter the number you want to check:")
num=int(input())
square=num*num
flag=0
while(num>0):
if(num%10!=square%10):
print("No, it is not an automorphic number.")
flag=1
break

num=num//10
square=square//10
if(flag==0):
print("Yes, it is an automorphic number.")

0 comments on commit ff29792

Please sign in to comment.