Results 1 to 3 of 3

Thread: Automorphic numbers

  1. #1
    Junior Member
    Join Date
    Feb 2007
    Answers
    1

    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)


  2. #2
    Contributing Member
    Join Date
    Sep 2006
    Answers
    962

    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


  3. #3
    Junior Member
    Join Date
    Feb 2007
    Answers
    23

    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


  4.  Sponsored Ads
    Ad


     

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
About us
Applying for a job can be a stressful and frustrating experience, especially for someone who has never done it before. Considering that you are competing for the position with a at least a dozen other applicants, it is imperative that you thoroughly prepare for the job interview, in order to stand a good chance of getting hired. That's where GeekInterview can help.
Interact