Palindrome Program in C#

How to Write a Palindrome Programme using C# ? 

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”); } 




OutPut: Enter a String 
Madam is palindrome 
  1. Leave a comment

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


Get every new post delivered to your Inbox.

%d bloggers like this: