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

Is there any difference between int [] a and int a [] in c++?

947


How would you call C functions from C++ and vice versa?

1092


What are the four partitions in which c++ compiler divides the ram?

1173


What are c++ variables?

1007


What is a base class?

1052


Define a pointer to a data member of the type pointer to pointer?

940


Can we make any program in c++ without using any header file and what is the shortest program in c++.

1074


What is the difference between cin.read() and cin.getline()?

1017


Write is a binary search tree? Write an algo and tell complexity?

975


Write a program which is required to process the time of a clock in hours and minutes, entered from the keyboard. With this program, there are two requirements for any data entered by a user: 1. The data must be of the correct type (in this case, two ints). 2. The data must be in the correct range: this means that, for the minutes, negative numbers and any number above 59 must be rejected; for the hours, negative numbers and any number above 23 must be rejected. Output error message for invalid data input. Output the time one and a half hour after the time input. i.e. Hour: 22 Min: 32 One and a half hour after 22:32 is 00:02

1910


What is #include c++?

1047


How do I start a c++ project?

1004


Is set c++?

953


Is map ordered c++?

1042


Is java based off c++?

935