1. Welcome to TechPowerUp Forums, Guest! Please check out our forum guidelines for info related to our community.

"Backwards reader" program

Discussion in 'Programming & Webmastering' started by GSquadron, Apr 20, 2012.

  1. Kreij

    Kreij Senior Monkey Moderator Staff Member

    Joined:
    Feb 6, 2007
    Messages:
    13,881 (3.86/day)
    Thanks Received:
    5,632
    Location:
    Cheeseland (Wisconsin, USA)
    Here ya go , Alek. Palindrome code for a word or perfect palidrome phrase ...
    Code:
    
    string inputString;
    bool IsPalindrome = true;
    
    // Get input string however
    
    for (int i = 0; i < intputString.Length(); i++)
    {
        if (inputString[i] != inputString[(inputString.Length() - 1) - i]) 
        {
            IsPalindrome == false;
            break;
        }
    }
    
    if (!IsPalindrome)
    {
       // output the it's not a palindrome
    }
    else // output that it is a palindrome
    
    :toast:

    This is why coders have problems with relationships. The women keep feeding our "compilers" with ambiguous references and we keep getting unhandled exceptions. :laugh:
     
    Last edited: Apr 20, 2012
    GSquadron says thanks.
  2. GSquadron

    GSquadron

    Joined:
    Dec 2, 2009
    Messages:
    3,264 (1.27/day)
    Thanks Received:
    316
    Thanks!
    Oh well, in my country, you can find .net developers by microsoft. (fake one)
    So C++ is for no job at all. Those who learnt programming languages, went outside
    of the town to find a job. Maybe after 20 years, the situation will change.

    EDIT: Still, coping and pasting your code on my compiler doesn't work!
    Made mods, still doesn't....
     
    Last edited: Apr 20, 2012
  3. Kreij

    Kreij Senior Monkey Moderator Staff Member

    Joined:
    Feb 6, 2007
    Messages:
    13,881 (3.86/day)
    Thanks Received:
    5,632
    Location:
    Cheeseland (Wisconsin, USA)
    I know what you mean. Here in my little community there are zero jobs for any kind of programmers as it's a rural area.
    I would have to move to a city to get a coding job ... and I don't want to do that. I love the peace and solitude of the country life.
    So I just keep learning and use what I learn to help others instead of to make money.
    Probably why I'm broke. :laugh:
     

Currently Active Users Viewing This Thread: 1 (0 members and 1 guest)