Answer Posted / manindra agrawal
using System;
using System.Collections.Generic;
using System.Text;
class plaindrome
{
public static void Main()
{
string str1="";
int n,i=0;
int status=0;
System.Console.WriteLine("Enter the value...");
str1=Console.ReadLine(); // accept the value from the user
int len;
len=str1.Length; //calculating Lenght of the string
n=len;
while(i<n/2)
{
if(str1[i]==str1[n-1])
{
status=1;
i++;
n--;
}
else
status=0;
break;
}
if(status==1)
System.Console.WriteLine("Given string is plaindrom");
else
System.Console.WriteLine("Given String is not Plaindrome");
}
}
| Is This Answer Correct ? | 7 Yes | 5 No |
Post New Answer View All Answers
What is sqldataadapter in c#?
What is multithreading? What are the problems that comes with multithreading and how to manage them?
Is there a way of specifying which block or loop to break out of when working with nested loops?
What is assembly manifest?
Can list contain duplicates c#?
Can struct have constructor c#?
What is interface inheritance in c#?
What is difference between field and property in c#?
Why do we use interfaces in c#?
What is before string in c#?
Explain circular reference in c#?
What is difference between C# and VB.NET?
List the differences between method overriding and method overloading?
In gridview in editmode if we want to display information in one combobox based on
What is deferred execution?