-
Junior Member
Automorphic numbers
WAP to find whether the entire no. is automorphic. (ie the no. which if we make squre of it, its last digit should be same as the no. itself. ex: 5*5=25,6*6=36,.. are automorphic. while 3*3=9,7*7=49,.. are not)
-
Contributing Member
Re: Automorphic numbers
Its easy to find an number is automorphic or not....Get the last digit of the number. Check if the number is equal to (0 or 1 or 5 or 6 ). If yes then it is an automorphic number otherwise it is not.
-------------------
suresh
-
Junior Member
Re: Automorphic numbers
take the given number x.
compute y = x*x
compute z = y mod 10
if x == z then yse
else no
The mod operator basically returns the remainder. If mod 10 returns the number that we intitally used to square... you get the idea
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules