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 are logical operators in c#?
What are the different ways of method can be overloaded?
How can I get around scope problems in a try/catch?
What is concrete class in c#?
What is the difference between int16 and int32 in c#?
What is _viewstart cshtml?
Can we change static variable value in c#?
To whom a method is accesssed if it is marked as protected internal ?
What is the use of command builder?
What is difference between list and dictionary in c#?
Can I use parseint?
What is a generic method?
What is the default value of boolean variable?
How you will create satellite assemblies?
Can we have multiple threads in one app domain?