187. C Program to Check Number Automorphic or not.
How does this program work?
- This Program is used to check the given number is automorphic or not.
Here is the code
#include <stdio.h>
int main()
{
int n;
printf("Enter any number\n");
scanf("%d",&n);
// Condition for Automorphic case
if (n*n%10==n || n*n%100==n || n*n%1000==n)
printf("This is an automorphic number\n");
else
printf("This is not an automorphic number\n");
}