microprocessor program

Discussion in 'Programmer's Corner' started by sharma2k7, Dec 10, 2007.

  1. sharma2k7

    Thread Starter Active Member

    Dec 10, 2007
    36
    0
    can anyone tell me, that can we write palindrome program in microprocessor
     
  2. Dave

    Retired Moderator

    Nov 17, 2003
    6,960
    144
    Please read. There just isn't enough information to go on.

    Dave
     
  3. Papabravo

    Expert

    Feb 24, 2006
    10,136
    1,786
    Anything is possible. Practical is another matter entirely. Generating palindromes of random symbols is trivial and involves a simple data structure called a pushdown stack. Generating a meaningful palindrome in any of the planets natural languages is a bit tougher. A related problem called a fuzz phrase generator is easy and loads of fun to program and observe. Tell us more about what you had in mind.
     
  4. beenthere

    Retired Moderator

    Apr 20, 2004
    15,815
    282
    A bit tougher? No only does a palindrome have to be a mirror reflection in the characters used, it also has to make sense. Could any processor parse "Madam, I am Adam"? Or have come up with it to begin with? Drop the caps and punctuation and it's "madamiamadam". Nothing really jumps out to me.

    Can you make palindromes in Chinese?
     
  5. 3alaaking

    New Member

    Dec 12, 2007
    1
    0
    yea we can
     
  6. Papabravo

    Expert

    Feb 24, 2006
    10,136
    1,786
    It's not a palindrome in that form - you have to use the contraction I'm for "I am"
     
  7. beenthere

    Retired Moderator

    Apr 20, 2004
    15,815
    282
    Duh, yes. This addition is just padding for the message length to be long enough.
     
  8. sharma2k7

    Thread Starter Active Member

    Dec 10, 2007
    36
    0
    thanks for your reply i attended one interview actually the HR asked the question to me. can u tell me how can we assign strings in microprocessor? can we?
     
  9. Papabravo

    Expert

    Feb 24, 2006
    10,136
    1,786
    What gets assigned is a pointer to the first character in the string. The length is determined by having an "end" marker like a zero or null character. It is also possible to encode the length of a string in the string data.
     
  10. sharma2k7

    Thread Starter Active Member

    Dec 10, 2007
    36
    0
    thanks for your reply
     
Loading...