Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

write a recursive program in'c'to find whether a given five
digit number is a palindrome or not

Answer Posted / nikhil kumar saraf

void main()
{
int no,n,r=0,sum,a,c;
clrscr();
printf("Enter the number:-");
scanf("%d",&no);
n=no;
c=0;
while(n!=0)
{
n=n/10;
c++;
}
if(c!=5)
{
printf("The given number is not a five digit no.");
break;
}
else
{
n=no;
while(n!=0)
{
a=n%10;
r=(r*10)+a;
n=n/10;
}
if(r==no)
printf("The given no. is a pallidrom no.");
else
printf("The given no. is not pallidrom no.");
}
getch();
}

Is This Answer Correct ?    6 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

can we implement multi-threads in c.

1102


Why we use int main and void main?

1041


Is c procedural or functional?

995


What does *p++ do? What does it point to?

1017


What do you mean by keywords in c?

1101


What do you mean by recursion in c?

1070


how do you execute a c program in unix.

1091


which is an algorithm for sorting in a growing Lexicographic order

1760


What is extern variable in c with example?

972


What is the best way to comment out a section of code that contains comments?

1298


code for replace tabs with equivalent number of blanks

2110


What is the explanation for modular programming?

1166


What is #include stdio h and #include conio h?

1066


How will you write a code for accessing the length of an array without assigning it to another variable?

1024


What is hash table in c?

999