How to find palindrome using functions without arguments?

CODE




How to find palindrome using functions without arguments?

//Write a program to find palindrome using functions without arguments..

int main()
{
    void pal();
    pal();
}
void pal()
{
    int n,r,rev=0,m;
    printf("\n enter N:");
    scanf("%d",&n);
    m=n;
    while(m!=0)
    {
        r=m%10;
        rev=rev*10+r;
        m=m/10;
    }
    if (rev==n)
        printf("\n Number is palindrome");
    else
        printf("\n Number is not palindrome");
}


Output:
enter N:4564

 Number is not palindrome

How to find palindrome using functions without arguments? How to find palindrome using functions without arguments?  Reviewed by Unknown on December 31, 2018 Rating: 5

No comments:

If you have any doubt or query ,comment below:

Programming copyright © 2018-19. Powered by Blogger.