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

Write the syntax for catching an exception in c#?

491


What is the concept of strong names?

541


What is instantiating a class in c#?

485


What is the difference between == and object.equals?

509


What are the return types in c#?

497






What is jagged array?

550


What is xaml in c#?

505


Why do we need interfaces in c#?

487


What is tochararray in c#?

452


What is indexer c#?

469


What is firstordefault c#?

543


What is parallel foreach in c#?

551


What is jit (just in time)?

558


Why is dll used?

598


What is system console writeline in c#?

473