# Check if a number is Automorphic number

## What is Automorphic number : –

A number is said to be automorphic if it’s square is end with same digits as number itself.

for Example:- (5)²= 12**5 **( since 125 end with 5 so it is an Automorphic number )

2. (25)² = 6**25** ( since 625 end with 25 so it is an Automorphic number)

3. (376)²= 141**376 ** ( since 141376 end with 376 so it is an Automorphic number)

**Code in c++:- **

#include<bits/stdc++.h> using namespace std; int main() { int n; cout<<"Enter a number\n"; cin>>n; // count the number of digits int n1=n,dig=0; while(n1!=0) { dig+=1; n1/=10; } long long sq=pow(n,2); // finding the divisor long long divisor=pow(10,dig); // finding the number from the last of the squared number int last=sq%(divisor); // if number is finding from last of the squared number // is equal if(last==n) cout<<n<<" is a Automorphic number"<<endl; else cout<<n<<" is not a Automorphic number"<<endl; return 0; }

**Output:-**

Enter a number 25 25 is a Automorphic number

python code:-

import math n=int(input()) x=n*n s=str(n) n1=len(s) n2=pow(10,n1) res=x%n2 if (res)==n: print(n,"is a Automorphic number ") else: print(n,"is not a Automorphic number ")

output:-

6 6 is a Automorphic number

**Also check this:-**

__codechef problems:-__- Primary test
- Sum or difference
- point and line

__Wipro :-__

- Update the booking ID | Wipro previous year question paper solution
- Pages in PDF
- Find the location id
- Find the odd digits
- Find the Product ID

__Infytq :-__

__Key Points;-__

__Hackerrank:-__

- Python : missing characters : hackerrank solution
- Python : string transformation | Hackerrank solution
- Active Traders certification test problem | Hackerrank Solution
- Usernames changes certification test problem | Hackerrank Solution
- string Representation of objects certification test hackerrank solution
- Average Function | hackerrank certification problem solution

__C-tutorial:-__

- Micros in C
- Pointer in c
- Function declaration
- Types of user define function
- return type of function
- 2D array

__See more:-__

- c program to convert specified days into years weeks and days

- Print Reverse Hollow Pyramid
- Update the booking ID | Wipro previous year question paper
- Pages in PDF | Wipro previous year question paper
- Sparse Matrix in data structure
- Find the location ID | Wipro previous year Coding question
- find the odd digits | Wipro Coding question
- Find the product id | Wipro Coding question
- Difference between static and dynamic memory allocation
- What is asymptotic Notation