-1
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;


namespace Palindrome
{
    class Program
    {
        static void Main(string[] args)
        {
            char[] str = new char[10];
            Console.WriteLine("Enter The Palindrome Series(Max 10 Characters)");
            str = Console.ReadLine().ToCharArray();
            Console.WriteLine(CheckPalindrome(str));
        }
        private static bool CheckPalindrome(char[] mystring)
        {
            int startchar;
            int lastchar;
            startchar=0;
            lastchar=mystring.Length -1;
            while(startchar<lastchar)
            {
                if(mystring[startchar]==mystring[lastchar])
                {
                    startchar++;
                    lastchar--;

                }
                else
                {
                    return false;

                }
            }
            return true;

         }

        }
     }

how to hold the screen of the console ? As i am writing Console.ReadLine() in the code to hold the screen , but there is no response and i am getting the same result the program get exit automatically..

Please HElp

4
Contributors
3
Replies
14
Views
3 Years
Discussion Span
Last Post by Momerath
0

This line

char[] str = new char[10];

You can get rid of everything after str as you replace what was created when you assign the ReadLine() result to it.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.