Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

Write code for palindrome?

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


Please Help Members By Posting Answers For Below Questions

What is sqldataadapter in c#?

860


What is multithreading? What are the problems that comes with multithreading and how to manage them?

925


Is there a way of specifying which block or loop to break out of when working with nested loops?

963


What is assembly manifest?

973


Can list contain duplicates c#?

833


Can struct have constructor c#?

870


What is interface inheritance in c#?

880


What is difference between field and property in c#?

796


Why do we use interfaces in c#?

902


What is before string in c#?

877


Explain circular reference in c#?

900


What is difference between C# and VB.NET?

1051


List the differences between method overriding and method overloading?

914


In gridview in editmode if we want to display information in one combobox based on

2264


What is deferred execution?

838