Share your repls and programming experiences

← Back to all posts
22 Aug 19
jagdishhatwar (1)

#include<stdio.h>
int reverse(int num)//using reverse func also
{
int a,rev=0;
while(num>=1)
{
a=num%10;
rev=rev*10+a;
num=num/10;
}
return(rev);
}

void palindrome(int num)//decleare the palindrome function
{
int k;
k=reverse(num);
if(num==k)
{
printf ("is");
}
else
{
printf("Not");
}
}
int main()
{
int i;
printf("Enter the number:");//uservalue
scanf("%d",&i);
//j = reverse(i);
palindrome (1);// call the function palindrome to display output of
//palindrome function
}