Automorphic Number

Automorphic number or circular number is a number whose square ends in the same digits as the number itself.

For example,
$5^2 = 2\boldsymbol{5}\\ 6^2 = 3\boldsymbol{6}\\ 76^2 = 57\boldsymbol{76}\\ 890625^2 = 793212\boldsymbol{890625}\\ 7109376^2 = 5054322\boldsymbol{7109376}$
So, $$5, 6, 76, 890625, 7109376$$ are all automorphic numbers.

Below is a program to print automorphic numbers from $$1$$ to $$n$$:

Executing the program:
$gcc -o p automorphic_no.c -lm$ ./p
Enter n: 9999999
Automorphic numbers from 1 to 9999999 are
1, 5, 6, 25, 76, 376, 625, 9376, 90625, 109376, 890625, 2890625, 7109376,

If you've found any errors or want to give a feedback then comment below.