Resources » Code Snippets » Console Applications

Palindrome using C#

Updated: Category: Console Applications
Author: Member Level: GoldPoints: 8

Palindrome using

using System;
using System.Collections.Generic;
using System.Text;

namespace ConsoleApplication1
class Program
static void Main(string[] args)
string str=string .Empty ;

Console.WriteLine("Enter a String");

string s = Console.ReadLine();

int i = s.Length;
//we can get the Length of string by using Length Property

for (int j=i -1; j >= 0; j--)
str = str + s[j ];
if (str == s)

Console.WriteLine(s + " is palindrome");

Console.WriteLine(s + " is not a palindeome");




Did you like this resource? Share it with your friends and show your love!

Responses to "Palindrome using C#"
Author: Mrs. Meetu Choudhary Nanda  17 Feb 2009   Member Level: Gold   Points : 1

Please do provide description too along with you code to receive good responses and recognition points

Thanks and Regards
Meetu Choudhary

Author: Joe Kidd  23 May 2011   Member Level: Bronze   Points : 0
This is my version - it returns all palindromes in the input sentence:


Post Comment:

  • Do not include your name, "with regards" etc in the comment. Write detailed comment, relevant to the topic.
  • No HTML formatting and links to other web sites are allowed.
  • This is a strictly moderated site. Absolutely no spam allowed.
  • Name:   Sign In to fill automatically.
    Email: (Will not be published, but required to validate comment)

    Type the numbers and letters shown on the left.

    Submit Article     Return to Article Index
    Subscribe to Subscribers
    Active Members
    TodayLast 7 Daysmore...

    Awards & Gifts
    Talk to Webmaster Tony John

    Online Members

    sri raja
    Copyright © SpiderWorks Technologies Pvt Ltd., Kochi, India