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 program for palindrome

Answer Posted / prashant gupta

//Using C# Language

using System;

class Palindrome
{
public void CalculatePalindrome()
{
//int number;
Console.Write("Enter the no to check its
Palindromic property : ");
int number = int.Parse(Console.ReadLine());

int temp = number;
int sum = 0;

while (number > 0)
{

Int32 remainder = number % 10;
number = number / 10;
sum = sum * 10 + remainder;
}

if (sum == temp)
{
Console.WriteLine("The no {0} is
palindrome.", sum);
}

else
{
Console.WriteLine("The no {0} is not a
palindrom no.", sum);
}
}

public static void Main()
{
Palindrome _palindrome = new Palindrome();
_palindrome.CalculatePalindrome();
}
}

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How much do c++ programmers make?

1163


What is extern c++?

1059


Search for: what is pair in c++?

1175


What is encapsulation in C++? Give an example.

1152


How do you traverse a btree in backward in-order?

1095


Evaluate as true or false: !(1 &&0 || !1) a) True b) False c) Invalid statement

1256


What do you mean by early binding?

1131


What methods can be overridden in java?

1346


Why do we need c++?

1107


Is sorted c++?

1164


Explain selection sorting?

1130


Will a recursive function without an end condition every quit, in practice a) Compiler-Specific (Some can convert to an infinite loop) b) No c) Yes

1135


What is stoi in c++?

1233


What information can an exception contain?

1206


What is a pointer with example?

1335