Palindrome program in c# asp.net

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace palindrome
{
    class Program
    {
        static void Main(string[] args)
        {
       
          Console.WriteLine("Enter a String");
            string str = Console.ReadLine();
            string str1 = "" ;
 
            int i = str.Length;
           
            for (int j = i - 1; j >= 0; j--)
            {
                str1 = str1 + str[j];
            }
            if (str1 == str)
            {
                Console.WriteLine(str1 + " is palindrome");
            }
            else
            {
                Console.WriteLine(str1 + " is not a palindeome");
            }

            Console.ReadLine();

        }
    }
}



Palindrome program in c# asp.net Palindrome program in c# asp.net Reviewed by NEERAJ SRIVASTAVA on 9:10:00 PM Rating: 5

No comments:

Powered by Blogger.