-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathAutomorphic_Number.py
More file actions
34 lines (23 loc) · 945 Bytes
/
Copy pathAutomorphic_Number.py
File metadata and controls
34 lines (23 loc) · 945 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
"""
/*Question 1. Check whether a number is Automorphic number or not ?
Hint: An automorphic number is a number whose square ends with the number itself.
For example, 5 is an automorphic number, 5*5 =25. The last digit is 5 which same as the given number.
It has only a positive single digit number.
If the number is not valid, it should display “Invalid input“.
If it is an automorphic number display “Automorphic Number” else display “Not Automorphic Number”.
Input & Output format: Input consist of an integer.
Sample Input : 7
Sample Output : Not Automorphic Number
Another example of automorphic number is
6*6 = 36
25*25 = 625
76*76= 5776
Here all square ends with the number itself like square of 76 ends with 76 itself.*/
"""
#Here is Code
#Take Input
n = int(input("Enter Number = "))
if((n%10)==(n*n%10)): # Check Condition
print(n,"is Automorphic Number\n")
else:
print(n,"is Not Automorphic Number\n")