Answer Posted / dadi
static void checkPalindrome()
{
Console.WriteLine("please enter a string");
string str = Console.ReadLine();
bool isPalindrome = true;
int count = str.Length;
for (int i = 0; i < count / 2; i++)
{
if (str[i] != str[count - i - 1])
{//check char[0]==char[n-1], char[1]== char[n-2] and so on......
isPalindrome = false;
break;
}
}
Console.WriteLine("entered string {0} is {1} palindrome", str, (isPalindrome) ? "a" : "not a");
Console.Read();
}
| Is This Answer Correct ? | 2 Yes | 1 No |
Post New Answer View All Answers
Is string primitive?
Is hashset serializable c#?
What are the classes contained in a single .NET DLL ?
What is the difference between class and namespace?
How to do and Apply Themes to Datagrid,Lable,Textbox,etc., in C#.NET 2005 Windows Application? (like who we will do themes in ASP.NET using .CSS and .SKIN files). Urgent!!
Explain the types of assemblies in .net?
What is the difference between protected and internal in c#?
Can you declare a class or a struct as constant?
What is strongly typed in c#?
What is the default boolean value in c#?
In a C# class we have a SortedList member m_addinProjects
we want to provide an iterator to allow the consumer of
this class access to the items in the collection. Please
provide an iterator method for the AnalyzeAddinsDLL class
below and an example of how it would be used.
namespace AnalyzeAddinsDLL
{
public class AllAddInProjects
{
private SortedList
What is type safe code?
Can you prevent a class from being instantiated?
What is the purpose of abstract class in c#?
How do you serialize in c#?