Write code for palindrome?

Answer Posted / irfan khan

string s1="";
string s2="";
int len=s1.length;
for(int i=0;i<len-1;i++)
{
s2=s1.substring[i]+s2;
console.writeline(s2);
}
if(strcmp(s1,s2)==0)
{
console.writeline("given sting is palindrome");
}
else
console.writeline("not palindrome");

Is This Answer Correct ?    12 Yes 8 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain more on CLR

747


What is the benefit of using interface in c#?

495


Why abstract class is not instantiated in c#?

520


How can I check the type of an object at runtime?

524


What is predicate builder?

475






What are access modifiers in c#?

548


What is the difference between console application and windows application?

476


How Is The Dll Hell Problem Solved In .net?

594


What is polymorphism c# example?

483


Can we maintain state in webservice?

500


What is meant by clr?

567


Explain the constructor in c#.

568


What is encapsulation in csharp?

513


What is the difference between system.text.stringbuilder and system.string?

527


Explain attributes in c#?

477