Monday, 6 January 2020

HAY THANK FOR VISIT

<<<<<<LET'S START WITH ANOTHER QUESTION>>>>>>>>>>>>>

QUESTION---TO CHECK THAT THE  GIVEN NUMBER IS PALENDROM OR NOT..


class Palendrom
{
    void main(int n)
    {
        int d=0;int rev=0;int t=n;
        while(n>0)
        {
            d=n%10;
            rev=rev*10+d;
            n=n/10;
        }
        n=t;
        if(n==rev)
        System.out.println("Palendrom number");
        else
        System.out.println("not a Panlendrom number");
    }
}

input---121
output---

No comments:

Post a Comment

HAY THAKYOU FOE VISIT

Program(python):-Find duplicates in an array (Geeks for geek problem)

QUESTION:- Given an array  a  of size  N  which contains elements from  0  to  N-1 , you need to find all the elements occurring more than o...