Friday, 26 August 2011

Palindrome Number Logic

int given_no = 656, final_rev_no = 0, temp = 0,initialno;
initialno = given_no;
while (given_no > 0)
{
    temp = given_no % 10;
    final_rev_no = final_rev_no * 10 + temp;
    given_no /= 10;
}
if (final_rev_no == initialno)
    lblmessgae.Text = "Given Number is Palindrome Number";//print your statement
else
    lblmessgae.Text = "Given Number is not a Palindrome Number";//print your else statement

Tag: Palindrome, Palindrome in asp.net, Palindrome in c, Palindrome in c++, Palindrome in cpp, Palindrome logic, Palindrome program in c, Palindrome program in c#, Palindrome program in cpp

No comments:

Post a Comment

Parsing JSON w/ @ symbol in it

To read the json response like bellow @ concatenated with attribute                             '{ "@id": 1001, "@name&q...