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 connection pooling in ado.net?
Can you mark static constructor with access modifiers?
What are the fundamental principles of oo programming?
How do you specify a custom attribute for the entire assembly?
What is int parse in c#?
Explain types of comment in c# with examples
What will a loop recorder show?
Is c# code is managed or unmanaged code?
Why reflection is used in c#?
How to implement a singleton design pattern in c#?
What does int32 mean?
How to implement an object pool in c#.net.
What's c# ?
What is inner class in c#?
Is stringbuilder better than string?