First we need to understand What is Automophic numbers? A number whose square's last degit(s) are equal to that number. Some example of automorphic number is 1, 5, 6, 25, 76
5 ^2 = 25
So here square of 5 is 25 and last digit of 25 is 5. And its equal to 5.
Source Code to check Automorphic number
long int n,no=0,s,rem=0,ans=0,temp;
printf("Enter a number: ");
printf("no is automorphic");
printf("no is not automorphic");