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 the difference between convert.tostring() and tostring() functions ?
Explain the difference between a sub and a function in c#.
What is the difference between class and namespace?
Is array passed by reference in c#?
What are cshtml files?
Can constructor have return type c#?
Explain dataset.acceptchanges method in .net?
What is a constructor in c#?
Why to use lock statement in c#?
Can a string be null c#?
What are the delegates in c#?
Does google use c#?
What is the difference between array and arraylist c#?
Why delegates are required?
Can hashtable have duplicate keys in c#?