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 the difference between convert.tostring() and tostring() functions ?

988


Explain the difference between a sub and a function in c#.

951


What is the difference between class and namespace?

918


Is array passed by reference in c#?

919


What are cshtml files?

828


Can constructor have return type c#?

972


Explain dataset.acceptchanges method in .net?

897


What is a constructor in c#?

1256


Why to use lock statement in c#?

878


Can a string be null c#?

843


What are the delegates in c#?

894


Does google use c#?

845


What is the difference between array and arraylist c#?

975


Why delegates are required?

909


Can hashtable have duplicate keys in c#?

829