//Num is our given number obtained from date

Int num1,num2;

Int count1=0,count2=0;

void nearestpalindrome()

{

                            Num1=num;

                            For(;;)

                            {

                                                If(Checkpalindrome(num1))

                                                Break;

                                                Num1++;

                                                Count1++;

                            }

                            Num2=num;

                            For(;;)

                            {

                                                If(Checkpalindrome(num2))

                                                Break;

                                                Num2--;

                                                Count2++;

                            }

If(count1<count2)

Print(num1);

Else

Print(num2);

}






On Mon, Sep 5, 2011 at 10:09 PM, Neha Singh <neha.ndelhi.1...@gmail.com>wrote:

> @sukran :  there r a  lot of bugs ..   read the question carefully. Its not
> that simple.  Why do u think the month shud always be 11  and why r u
> decrementing the year by one, we have to find the next palindromic date that
> means the returned date must be greater than the given date.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.

Reply via email to